<template>
    <!-- <a-layout-content :style="{ margin: '0px 16px 0 16px', overflow: 'initial' }"> -->

    <div class='container_box'>
      
        <a-layout-header
          class="header_sty"
          :style="{ position: 'fixed', zIndex: 999 }"
          style="width: 100%; background: #fff; padding: 0 40px;background:#ED6A1F;"
        >
          <!--面包屑 -->
          <!-- <a-breadcrumb class="breadcrumb">
            <a-breadcrumb-item>首页</a-breadcrumb-item>
            <a-breadcrumb-item
              v-for="(bread, index) in $route.meta"
              :key="index"
              >{{ bread.title }}
            </a-breadcrumb-item>
          </a-breadcrumb> -->
          <div>
                  <img style='width:60px;height:60px;border-radius:30px;' :src="headImgUrl" alt=""  />
                  <span style='font-size:18px;color:white'>{{ storeName }}</span>
                </div>
               
          <!--面包屑 结束-->
         <div style="display:flex;align-items:center;color:white;font-size:16px;">
          <!-- <div @click="goTopFunc" style="margin-right:10px;">回到顶部</div> -->
          <span> {{ nowDate  }}</span>

          <span @click='rightTopClick(1)' class='iconfont icon-jianhao margin-10' style='font-size:25px;'></span>
          <span @click='rightTopClick(2)' class='iconfont icon-juxing' style='font-size:20px;'></span>
          <span @click='rightTopClick(3)' class='iconfont icon-guanbi  margin-10' style='font-size:20px;'></span>
       
          <!-- <div class="header_out" @click="logout">
           
            <a-icon type="poweroff" style="margin-right: 5px" />退出登录
          </div> -->
         </div>
          
        </a-layout-header>
   <!-- -->
   <Keyboard  
  class='border_cl' :option="option" @keyValModify="getInputValue" @close="option.show = false" ></Keyboard>
  <Keyboard class='border_cl' :option="option2" @keyValModify2="getInputValue2" @close2="option2.show = false"></Keyboard>
    <div class='meal_all_box' :style="{height:currentScreenHeight+'px'}">
      <div class='meal_left_box' :style="{height:currentScreenHeight+'px'}"  ref="left_scroll" >
        <!--  -->
          <div class="meal_top_box">

          <div class="margin_fill">

            <!-- <a-input-number v-model="telephone" style="width: 230px" placeholder="请输入手机号" /> -->
            <!-- <key-input class="demo-class"  style="width: 230px"></key-input> -->
            <!-- <div ref="keyboard" class='input_class'  @click="onFocus">{{telephone}}</div> -->
            <input type="text" ref="keyboard" class='input_class' v-model="telephone" @focus="onFocus">

         
              
      <!-- <div class="wrap">
   
   <div v-drag class="box" 
    >gfdgfdgfdgf</div>
 </div> -->

 <!-- <div class="wrap"> -->
   
<!-- </div>  -->


            <a-button type="primary" style="margin:0 0 0 5px ;background:#ED6A1F;border:none" @click="checkFunc(false)"> 查找</a-button>
            <!-- <a-button type='cancel' style='margin:0 10px;' @click='mealSettingFunc'>   点餐设置 </a-button>
            <a-button type='cancel' @click='ticketMachineFunc'>   小票机管理 </a-button> -->

          </div>

          <div class="margin_fill" style='flex-direction:column;align-items:start;' v-if="getOftenList.length" >  
            <div class="left_word_box" style='flex-shrink:0;'>
              <!-- <span class="require_fill_star" style='visibility:hidden;'>*</span> -->
              <span class='line_header_14'>常用用户</span>
            </div>
            <div class="often_mobile_box">
              <div v-for="(item,index) in getOftenList" :key="index"  :class='currentOftenUseIndex==index?"select_mobile_item":"un_select_mobile_item"' @click="selectOneOftenFunc(index,item.phone)">
                <span >{{item.phone}}</span>
                <a-icon style="color: rgba(0, 0, 0, 0.45);margin-left:7px;" type="close"  @click.stop="deleteOftenUseFunc(item.id)" />
                <!-- <span style="color: rgba(0, 0, 0, 0.45);margin-left:7px;" class="iconfont icon-guanbi" @click.stop="deleteOftenUseFunc(item.id)"></span> -->
              </div>

            </div>
      
          

          </div>


          <!-- <imggroup >2342343243</imggroup> -->
          <!-- <div style='width:100px;height:200px;background:red;' @touchstart="onTouchStart"
      @touchmove="onTouchMove"
      @touchend="onTouchEnd"
      :style="{ top: logoPosition.y + 'px', left: logoPosition.x + 'px' }">gfdgfdgfdgf</div> -->

   
      
          <div class="margin_fill" v-if='currentUserSelect'>
              <div class="select_user_box">
                  <ul >
                  <li>
                  <div class="check_left" style='margin-left:20px;'>
                      <div>
                      <img
                          style="width: 50px; height: 50px; border-radius: 25px"
                          :src="currentUserInfo.user.headImgurl"
                          alt=""
                      />
                      </div>

                      <div style="margin-left: 16px">
                      <div style="display: flex">
                          <span style='color:#999999'>姓名：</span>
                          <span style="font-weight: 700;color:#000000">{{ currentUserInfo.user.username }}</span>
                      </div>
                      <div style="display: flex">
                          <span style='color:#999999'>手机：</span>
                          <span style="font-weight: 700;color:#000000">{{ currentUserInfo.user.phone }}</span>
                      </div>
                      </div>
                  </div>

                  <!-- v-if="showBuyBtn" -->
                  <div class="gold_box" >
               <span
                style="border: none; color: #ed6a1f"
                @click="chargeVipFunc(currentUserInfo.user.id)"
              >
                开通会员
              </span>
              <span
                style="margin-top:10px;border: none; color: #ed6a1f;margin-right:10px;"
                @click="goldExchangeClick(currentUserInfo.user.id)"
              >
                金豆兑换
              </span>
            </div>
               
                  </li>

      
                
              </ul>

          </div>
          </div>
        
          <!-- <div class="margin_fill" style='flex-direction:column;align-items:start;' v-if="showBuyBtn"  >  
            <div class="left_word_box" style='flex-shrink:0;'>

              <span class='line_header_18'>购买会员卡</span>
            </div>

            <div class="eat_methods_box">
              <div v-for="(item,index) in buyCardSelectList" :key="index"  :class='currentCardSelectIndex==index?"select_eat_item":"un_select_eat_item"' @click="cardSelectListFunc(index,item)">
                <span >{{item.name}}</span>
                <span  v-if='currentCardSelectIndex==index' style='position:absolute;right:0;bottom:0;right:-3px;bottom:-8px;' class="iconfont icon-jiaobiaoxuanzhong right_check"></span>
   
              </div>

            </div>

          </div> -->

          <div class="margin_fill" style='flex-direction:column;align-items:start;'  >  
            <div class="left_word_box" style='flex-shrink:0;'>

              <span class='line_header_18'>就餐方式<span class="require_fill_star" >*</span></span>
            </div>

            <div class="eat_methods_box">
              <div v-for="(item,index) in eatMethodsList" :key="index"  :class='currentEatMethodsIndex==index?"select_eat_item":"un_select_eat_item"' @click="selectEatMethodsFunc(index,item)">
                <span >{{item.name}}</span>
                <span  v-if='currentEatMethodsIndex==index' style='position:absolute;right:0;bottom:0;right:-3px;bottom:-8px;' class="iconfont icon-jiaobiaoxuanzhong right_check"></span>
   
              </div>

            </div>

          </div>



          
        
          <div class="margin_fill" style='flex-direction:column;align-items:start;' v-if="eatMethodsType==3" >  
            <div class="left_word_box" style='flex-shrink:0;'>

              <span class='line_header_18'>桌号<span class="require_fill_star" >*</span></span>
            </div>

            <div class="table_num_box">
              <div v-for="(item,index) in dealTableNumList" :key="index"  :class='currentTableNumIndex==index?"select_table_num_item":"un_select_table_num_item"' @click="selectTableNumFunc(index,item)">
                <span > {{item.groupName}}{{item.deskName}}</span>
                <span  v-if='currentTableNumIndex==index' style='position:absolute;right:0;bottom:0;right:-3px;bottom:-8px;' class="iconfont icon-jiaobiaoxuanzhong right_check"></span>
                
              </div>

            </div>



          </div>

      </div>

      <div class="meal_bottom_box" v-if="car_total_count">


              <div class="car_box" >

            <div class="margin_fill" style='flex-direction:column;align-items:start;'  >  
            <div class="left_word_box" style='flex-shrink:0;'>

              <span class='line_header_18'>已选商品</span>
            </div>

            
          </div>
            <div class="car_column_title">
              <span style="flex:2">图片</span>
              <span style="flex:3">商品</span>
              <span style="flex:1">单价</span>
              <span style="flex:1" v-if="eatMethodsType==4">包装费</span>
        
              <span style="flex:2">数量</span>
              <span style="flex:1;text-align: right;">小计</span>
              <span style="flex:1;text-align: right;">操作</span>
            </div>

            <div class="car_shop_cont">
              <div v-for="(item, index) in mealList" :key="index">
        
                 <div class="car_shop_info" v-if="item2.count" v-for="(item2, index2) in item.itemList" :key="index2" :style="{borderBottom:index2!=item.itemList.length-1?'1px solid #f2f2f2':''}">

                  <div style='flex:2;'>
                      <img :src='item2.image' style='width:41px;height:41px;'></img>
                  </div>
                  <div style='flex:3;margin:0 5px;'>
                      <div style="flex:3;color:000000;">{{item2.title}}</div>
                  <div v-if="item2.dishFlavorStr" style="color:#c1272d;">({{item2.dishFlavorStr}})</div>
                  </div>
                  <span style="flex:1;color:#c1272d;">￥{{item2.price}}</span>
                  <span style="flex:1" v-if="eatMethodsType==4">￥{{item2.packingFee*item2.count}}</span>
   
                  
                  <div v-if='parseInt(item2.unitFlag)!=2'  style="flex:2" >

                      <div class="car_meal_input_ope">
                          <div class='car_input_ope_left_btn' @click="minusCarMealFunc(index, index2)">
                            <a-icon class="" type="minus"  />
                          </div>
        
                          <input @input="value => changeTitle(value, index, index2)" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" 
                          :value="item2.count"
                          style="width: 42px;" class="input_border"
                            placeholder="请输入数量" />
                          <div class="car_input_ope_right_btn" @click="addCarMealFunc(index, index2)" >
                            <a-icon type="plus" />
                          </div>

                       </div>

                  </div>


                    <div style='flex:1' v-if='parseInt(item2.unitFlag)==2'   >
                    
                       <div style='width:94px;'>{{item2.customWeight}}千克</div>
                     

                      </div>




                  <span  v-if="eatMethodsType==4" style="flex:1;text-align: right;margin:0 20px;">￥{{(item2.price*item2.count + item2.packingFee*item2.count).toFixed(2)}}</span>
                  <span  v-else style="flex:1;text-align: right;margin:0 20px;">￥{{(item2.price*item2.count).toFixed(2)}}</span>
                  <!-- <span @click='deleteCarItem(index,index2)' class='iconfont icon-shanchu1' style='flex:1;font-size:14px;'> </span> -->
                  <div @click='deleteCarItem(index,index2)'  style='flex:1;font-size:14px;text-align:right'>
                            <a-icon   type="delete"  />
                          </div>
                </div> 

                                             
                           <div  v-if="item2.realDifferentGuideList" v-for="(item2, index2) in item.itemList" :key="index2">

                                      <div class="car_shop_info"  v-for="(item3, index3) in item2.realDifferentGuideList" :key="index3" :style="{borderBottom:index2!=item2.realDifferentGuideList.length-1?'1px solid #f2f2f2':''}">

                      <div style='flex:2;'>
                          <img :src='item2.image' style='width:41px;height:41px;'></img>
                      </div>
                      <div style='flex:3;'>
                          <div style="flex:3;color:000000;">{{item2.title}}</div>
                      <div style="color:#c1272d;">({{item3.guideName}})</div>
                      </div>
                      <span style="flex:1;color:#c1272d;">￥{{item3.skuPrice}}</span>
                      <span style="flex:1" v-if="eatMethodsType==4">￥{{item2.packingFee*item2.count}}</span>
             

                      <div v-if='parseInt(item2.unitFlag)!=2'  style="flex:2" >

                          <div class="car_meal_input_ope">
                              <div class='car_input_ope_left_btn' @click="minusCarGuideMealFunc(index, index2,index3)">
                                <a-icon class="" type="minus"  />
                              </div>
                             
                              <input @input="value => changeTitle(value, index, index2)" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" 
                              :value="item3.guideCount"
                              style="width: 42px;" class="input_border"
                                placeholder="请输入数量" />
                              <div class="car_input_ope_right_btn" @click="addCarGuideMealFunc(index, index2,index3)" >
                                <a-icon type="plus" />
                              </div>

                          </div>

                      </div>


                        <div style='flex:1' v-if='parseInt(item2.unitFlag)==2'   >
                   
                          <div style='width:94px;'>{{item3.guideCount }}千克</div>
                        

                          </div>




                      <span  v-if="eatMethodsType==4" style="flex:1;text-align: right;">￥{{(item3.skuPrice*item3.guideCount + item2.packingFee*item3.guideCount).toFixed(2)}}</span>
                      <span  v-else style="flex:1;text-align: right">￥{{(item3.skuPrice*item3.guideCount).toFixed(2)}}</span>
                      <!-- <span @click='deleteGuideCarItem(index,index2,index3)' class='iconfont icon-shanchu1' style='flex:1;font-size:14px;'> </span> -->
                          <div @click='deleteGuideCarItem(index,index2,index3)'  style='flex:1;font-size:14px;text-align:right'>
                            <a-icon   type="delete"  />
                          </div>


                      </div>
                     </div>









              


              </div>







            </div>

<!-- 

            <div class="car_cal_price">
              <div class="total_box">
                <span >共计({{car_total_count}}个商品)</span>
             
              </div>
              <div class="total_box">
             
                <div>

                  <span> 合计 (CNY)：</span>

                  <span   style="color:#C1272D;font-size:24px;">¥ {{carl_total_price.toFixed(2)}}</span>
                </div>
              </div>

            </div> -->


          </div>
          <div class="margin_fill" style='display:flex;justify-content:center;margin:0;'>
              <!-- <div  style="
              width: 127px;
              height: 40px;
              font-size: 18px;
              background-color: #1F58BC;
              border:1px solid #1F58BC;
              font-size: 14px;
             flex:1;
             display:flex;align-items:center;justify-content:center;color:white;
          " @click="clearClick">
          清空
                  </div>
              <div style="
              width: 127px;
              height: 40px;
              font-size: 18px;
              border:1px solid #ED6A1F;
              background-color: #ED6A1F;
              font-size: 14px;
            flex:1; display:flex;align-items:center;justify-content:center;color:white;
          " @click="submitClick">
          下一步
                  </div> -->
          </div>

          </div>
  


       



        

      </div>

      <div class='meal_right_box'   :style="{height:(currentScreenHeight + 60) +'px'}">
            <div class='cate_meal_box'  id="tab_nav">
              <div :class="index==currentIndex?'select_cate_item':'unselect_cate_item'" v-for="(item, index) in mealList" :key="index" @click='cateClick(index)'>
                <span style='flex-shrink:0;'>{{ item.name }}</span>
              </div> 
            </div> 

         
            <div class="meal_list" v-for="(item, index) in mealList" :key="index" v-if='index==currentIndex'>
                <div class="meal_box">

                    <div v-for="(item2, index2) in item.itemList" :key="index2" style="width: 167px;margin-bottom:7px;">
                    <div class="meal_content_box" style="background:#f2f2f2;width: 160px;margin-right:7px">
                        <div class="meal_img_box"  @click='shopItemClick(index,index2,item2)'>
                        <img @dragstart.prevent
                        style="width:158px;height:158px;border-top-left-radius: 10px;border-top-right-radius: 10px;"
                        :src="item2.image" alt="" />
                        <img v-if="item2.unitFlag==1&&item2.num==0" class="sale_out_img" src="http://feiyangimage.oss-cn-shanghai.aliyuncs.com/sale_out_gray_new.png" alt="">
                        <img v-if="item2.unitFlag==2&&item2.weight==0" class="sale_out_img" src="http://feiyangimage.oss-cn-shanghai.aliyuncs.com/sale_out_gray_new.png" alt="">
                        </div>
                            <div @click='stockShowFunc(index,index2,item2)'>
                                <div class='shop_title'>
                                    <span class='title_de'> {{ item2.title }}</span>
                                </div>

                                <div style="display:flex;flex-direction:column">
                                    <div class="price_guide_box">
                                    <span>¥{{ item2.price }}</span>
                
                                    <!-- <span v-if="item.id!=9999&&item2.dishAttrList!=null&&item2.num!=0&&item2.dishAttrList.length!=0" >选规格</span> -->
                                    <span v-if="item.id==9999&&item2.surplusUse>0" >剩余次数{{item2.surplusUse}}</span>
                                    <span v-if="item.id==9999&&item2.surplusUse<=0" >剩余次数0</span>
                                    

                                    </div>
            
                                </div>
                            </div>
                    </div>
                    </div>

                </div>
            </div>
      </div>




<!-- <div  class="bottom_ope_box" >
    <div class="bottom_left_box" >
                  
                <div class='shop_ca_b' v-if="car_total_count">
                            
                             <div class="car_cal_price" style='width:100%;padding:0 20px;background:white;'>
                                <div class="total_box">
                                    <span >共计({{car_total_count}}个商品)</span>
                                
                                </div>
                                <div class="total_box">
                                
                                    <div>

                                        <span> 合计 (CNY)：</span>

                                        <span   style="color:#C1272D;font-size:24px;">¥ {{carl_total_price.toFixed(2)}}</span>
                                    </div>
                                </div>

                            </div>

                </div>

                <div class='shop_ca_b'  v-else>
                    <div class="car_cal_price" style='width:100%;padding:0 20px;background:white;'>

                    </div>
                    </div>

     
                <div  class='shop_ca_b'>
                  <div  style="
                        width: 127px;
                        height: 50px;
                        font-size: 18px;
                        background-color: #1F58BC;
                        border:1px solid #1F58BC;
                        font-size: 14px;
                        flex:1;
                        display:flex;align-items:center;justify-content:center;color:white;
                    " @click="clearClick">
                    清空
                            </div>
                        <div style="
                        width: 127px;
                        height: 50px;
                        font-size: 18px;
                        border:1px solid #ED6A1F;
                        background-color: #ED6A1F;
                        font-size: 14px;
                        flex:1; display:flex;align-items:center;justify-content:center;color:white;
                    " @click="submitClick">
                    下一步
                            </div>
                    </div>

     </div>
    <div class="bottom_right_box" >
        <div style='background:transparent;'>
           
        </div>

        <div class='right_oprt'>
            <div class='ope_b'   @click="orderClick">

                <a-icon type="container" />
                <span class='text-op'>订单</span>
            </div>
            <div class='bottom_right_ope'>
                <div class='ope_b' style='margin-right:30px;'>
                    <a-icon type="user" />
                    <span class='text-op'>{{userName}}</span>
                </div>
                <div  class='ope_b'  @click="quitFunc">
                        <a-icon type="logout" />
                    <span class='text-op'>退出登录</span>
                </div>
            </div>       
           
        </div>
        
    </div>
</div> -->
      








    </div>

<div class="frequently_toast_box" v-if="frequentlyToastShow"></div>

  <!-- 查找用戶 -->
  <div
    class="toast_box"
    v-if="addShow"
    @click.self="hide"
    @touchmove.prevent
    @mousewheel.prevent
  >
    <div class="add_toast_box">
      <div class="add_top">
        <span style="font-size: 16px; font-weight: 700">查找用户</span>
        <span @click="closeBtnClick"><a-icon type="close" /></span>
      </div>

      <div class="add_bottom">
        <ul >
          <li>
            <div class="check_left">
                <div>
                <img
                  style="width: 50px; height: 50px; border-radius: 25px"
                  :src="currentUserInfo.user.headImgurl"
                  alt=""
                />
              </div>

              <div style="margin-left: 16px">
                <div style="display: flex">
                  <span>姓名：</span>
                  <span style="font-weight: 700">{{ currentUserInfo.user.username }}</span>
                </div>
                <div style="display: flex">
                  <span>手机：</span>
                  <span style="font-weight: 700">{{ currentUserInfo.user.phone }}</span>
                </div>
              </div>
            </div>
            <div class="check_right">
               <span
                style="border: none; color: #7bb0e8"
                @click="addOftenUseFunc(currentUserInfo.user.id)"
              >
                {{oftenText}}
              </span>
              <span style="color: transparent">x</span> 
            </div>
          </li>

 
          <div
            style="
              padding: 10px 30px;
              border-top: 1px solid #eee;
              text-align: right;
            "
          >
            <a-button @click="closeBtnClick">取消</a-button>
            <a-button
            class='cle-box'
              type="primary"
              @click="sureUserBtn()"
            >
              确认
            </a-button>
          </div>
        </ul>

      
      </div>
    </div>
  </div>


  <a-modal
      v-model="goldExchangeShow"
      title="金豆兑换"
      ok-text="兑换"
      cancel-text="取消"
      @ok="onSure"
    >
      <div class="toast_container_box">
        <span class="left_word"  style='flex-shrink:0;'>卡号：</span>
        <a-input     
          v-model="cardNo"
          class="right_input"
          placeholder="请输入卡号"
        />
      </div>

   

      <div class="toast_container_box mg24"> 
        <span class="left_word" style='flex-shrink:0;'>密码：</span>
        <a-input
          v-model="cardPassword"
          class="right_input"
          placeholder="请输入密码"
        />
        
      </div>
    </a-modal>

  <!-- :width ="addCouponWidth" -->
  <a-modal :width='800' v-model="buyShow" title="购买会员卡" @ok="handleOk" @cancel="onCropperCancel"   ok-text="购买"
    cancel-text="取消">

    <div class="margin_fill" style='flex-direction:column;align-items:start;margin:0;'  >  
            <div class="left_word_box" style='flex-shrink:0;'>

              <span class='line_header_18'>选择会员卡</span>
            </div>

            <div>
              <ul class='card_select_ul'>
                <li class='card_select_li' style='background:#fafafa;'>
                   <div style="width:60px"></div>
                   <div>购买状态</div>
                   <div>会员卡名称</div>
                   <div style='flex:2'>时间</div>
                   <div>有效期(月)</div>
                   <div>状态</div>
                   <div>售价(元)</div>
                   <div>支付折扣</div>

                </li>
                <!--    :style="{disabled:item.buyFlag==1?true:false}"-->
                <li v-for="(item,index) in onlineData" :key='index' class='card_select_li' :style="{background:parseInt(item.buyFlag)==1?'rgb(245,245,245)':'white'}" >
                  <!-- <a-radio-group v-if='parseInt(item.buyFlag)==1' disabled>
                      <a-radio :checked='true'>
                      
                      </a-radio>
                      </a-radio-group>
                      <a-radio-group v-if='parseInt(item.buyFlag)!=1' v-model="currentRadioChecked" @change="onRadioChange1">
                      <a-radio >
                        
                      </a-radio>
                    </a-radio-group> -->

                  <a-radio v-if='parseInt(item.buyFlag)==1' style='width:60px;text-align:center;' :checked='parseInt(item.buyFlag)==1?true:false' :disabled='parseInt(item.buyFlag)==1?true:false'></a-radio>
                  <a-radio v-if='parseInt(item.buyFlag)!=1' style='width:60px;text-align:center;' :checked='index== currentRadioIndex' @change="onRadioChange2(index)"></a-radio>


                   <div>{{item.buyFlag==0?'未购买':'已购买'}}</div>      
                   <div>{{item.name}}</div>
                   <div  style='flex:2'>{{item.createTime | formatDate}}</div>
                   <div>{{item.validMonth}}</div>
                   <div>{{item.status}}</div>
                   <div>{{item.cardPrice}}</div>
                   <div>{{item.payRate*100/10}}折</div>

                   
                </li>
              </ul>
            </div>

     

          </div>

          <div class="margin_fill" style='flex-direction:column;align-items:start;'  >  
            <div class="left_word_box" style='flex-shrink:0;'>

              <span class='line_header_18'>支付方式</span>
            </div>

            <div class="table_num_box">
                                  <div v-for="(item,index) in buyCardPayList" :key="index"  :class='currentBuyCardIndex==index?"select_normal_item":"un_select_normal_item"' @click="selectBuyCardFunc(index,item)">
                                      <span >  {{item.name}}</span>
                                  <span  v-if='currentBuyCardIndex==index' style='position:absolute;right:0;bottom:0;right:-3px;bottom:-8px;' class="iconfont icon-jiaobiaoxuanzhong right_check"></span>
                                  
                                  </div>

                              </div>

            


          </div>
          
          <div class="margin_fill" style='border-bottom:1px solid #f2f2f2;flex-direction:column;align-items:start;' v-if="currentBuyCardPayId==1">  

<div class="left_word_box" style='flex-shrink:0;'>

  <span class='line_header_18'>用户付款码标识<span class="require_fill_star">*</span></span>
  </div>
<a-textarea  class='textarea_bg' ref='authCodeNameBuyCard' style="width: 100%;" placeholder="请用扫码枪扫用户付款码,注意务必将鼠标光标置于该输入框内,并处于闪烁状态" allow-clear v-model="openVipAuthCodeChange"
  />

</div>



  </a-modal>



    <!-- 添加规格 -->
     <!-- 添加规格 -->
     <div
    class="guide_toast_box"
    v-if="addGuideShow"
    @click.self="hideGuide"
    @touchmove.prevent
    @mousewheel.prevent
  >
    <div class="add_toast_box">
                      <div class="add_top">
                      <span style="font-size: 16px; font-weight: 700">添加</span>
                      <span @click="closeGuideBtnClick"><a-icon type="close" /></span>
                      </div>
                      <div class="add_content_box" >
                  
                          <div v-for="(item,index) in currentAttributeList " :key="index">
                              <div class="tan_kuangtwo">
                                  <div class="num_box">{{item.attrName}}</div>
                              </div>

                              <div class="tag_tag_box">
                          
                                  <div v-for="(item2,index2) in item.attrValueList"  :index="index2">
                                  
                                      <div  @click="click_oneId(index,index2,item2)" :class="item2.tempSelect==true? 'tanactive tag_nei' : 'tanunactive tag_nei'">
                                          <span>{{item2.attrValue}}</span>
                                          <span  v-if='item2.tempSelect==true' style='position:absolute;right:0;bottom:0;right:-3px;bottom:-8px;' class="iconfont icon-jiaobiaoxuanzhong right_check"></span>
                                      </div>

                                  </div>
                              </div>
                          </div>
                              <div class="tan_kuangtwo">
                                  <div class="num_box">{{parseInt(mealList[currentLevel1].itemList[currentLevel2].unitFlag)!=2?'数量':'重量'}}</div>
                              </div>


                              <div class="meal_input_ope" v-if='parseInt(mealList[currentLevel1].itemList[currentLevel2].unitFlag)!=2'>

                                  <div class='input_ope_left_btn' @click="minusTempMealFunc(currentLevel1, currentLevel2)">
                                      <a-icon class="" type="minus"  />
                                  </div>
                                  <!-- 规格类 数量 guideInputCount-->
                                  <input v-if='currentAttributeList.length' @input="value => changeTitle(value, currentLevel1, currentLevel2)"
                                  onkeyup="this.value=this.value.replace(/\D/g,'')"
                                  onafterpaste="this.value=this.value.replace(/\D/g,'')"  :value='currentGuideCount'
                                  :ref="'standardKey' + mealList[currentLevel1].itemList[currentLevel2].id" class="toast_input_border toast_count_input" placeholder="规格数量" />
                                  <!-- 非规格类 数量-->
                                  <input v-if='!currentAttributeList.length' @input="value => changeTitle(value, currentLevel1, currentLevel2)"
                                  onkeyup="this.value=this.value.replace(/\D/g,'')"
                                  onafterpaste="this.value=this.value.replace(/\D/g,'')" :value="mealList[currentLevel1].itemList[currentLevel2].tempCount?mealList[currentLevel1].itemList[currentLevel2].tempCount:1"
                                  :ref="'standardKey' + mealList[currentLevel1].itemList[currentLevel2].id" class="toast_input_border toast_count_input" placeholder="请输入数量" />


                                  <div class="input_ope_right_btn" @click="addTempMealFunc(currentLevel1, currentLevel2)">
                                      <a-icon styel="font-size:14px;" type="plus"  />
                                  </div>

                              </div>

                              <div class="meal_input_ope" v-if='parseInt(mealList[currentLevel1].itemList[currentLevel2].unitFlag)==2'>

                                <!-- :ref="'weightKey' + mealList[currentLevel1].itemList[currentLevel2].id" -->
                               
                                 <!-- 规格类 重量   0.014
                                      0.615
                                        0.014

                                    onkeyup="this.value=this.value.replace(/\D/g,'')"
                                  onafterpaste="this.value=this.value.replace(/\D/g,'')"
                                -->
                                 <input v-if='currentAttributeList.length' ref='inputWeightRef' @input="value => changeGuideWeightTitle(value, currentLevel1, currentLevel2)"
                                   :value="currentGuideWeight"
                                  class="toast_weight_input_border toast_weight_input" placeholder="请输入重量" />

                                 <!-- 非规格类 重量  
                                     onkeyup="this.value=this.value.replace(/\D/g,'')"
                                 onafterpaste="this.value=this.value.replace(/\D/g,'')"
                                -->
                                 <input v-if='!currentAttributeList.length' ref='inputWeightRef' @input="value => changeWeightTitle(value, currentLevel1, currentLevel2)"
                                 
                                  :value="mealList[currentLevel1].itemList[currentLevel2].tempWeight"
                                  class="toast_weight_input_border toast_weight_input" placeholder="请输入重量" />

                                </div>

                      <!-- 百公里6个油  430公里  6*4.3 = 25.8*8.5 -->
                      </div>
 
                      <div class="add_choice_bottom">
                          <div class='choice_btn'   @click="sureGuideBtn()">选好了</div>
                       
                      
                      </div>
    </div>
  </div>
  <!-- :componentStockSkuList='stockSkuList' -->
  <modify-stock v-if='openStockShow' :compnentStockShow='openStockShow' @closeStock='closeStockDeal'  :currentItemId='childItemId' > </modify-stock>
  <div
    class="guide_toast_box"

    v-if="submitShow"
    @click.self="hideGuide"
    @touchmove.prevent
    @mousewheel.prevent
  >
    <div class="add_toast_box"       style='width:1050px;'>


      <div class="add_top">
                      <span style="font-size: 16px; font-weight: 700">确认结算</span>
                      <span @click="closeGuideBtnClick"><a-icon type="close" /></span>
                      </div>

                      <div class="add_all_box" >     
                          <div class="add_content_left_box" style='margin-right:10px;'>     

              

                              <div  class="margin_fill" style='padding:0 10px 15px 10px;border-bottom:1px solid #f2f2f2;flex-direction:column;align-items:start;' >  
                                  <div class="left_word_box" style='flex-shrink:0;'>

                                      <span class='line_header_18'>优惠券</span>
                                  </div>

                                  <div class="table_num_box" v-if='couponList.length'>
                                      <div v-for="(item,index) in couponList" :key="index"  :class='currentVoucherIndex==index?"select_normal_item":"un_select_normal_item"' @click="selectVoucherFunc(index,item)">
                                          <span> {{item.udcId==0?item.name:('满' + item.exceedMoney + '减' + item.discountsMoney + '元')}}</span>
                                      <span  v-if='currentVoucherIndex==index' style='position:absolute;right:0;bottom:0;right:-3px;bottom:-8px;' class="iconfont icon-jiaobiaoxuanzhong right_check"></span>
                                      
                                      </div>

                                  </div>

                                  <div class="table_num_box"  v-if='!couponList.length'>
                                      暂无优惠券

                                  </div>



                              </div>


                              <div class="margin_fill" style='padding:0 10px 15px 10px;border-bottom:1px solid #f2f2f2;flex-direction:column;align-items:start;'  >  
                                  <div class="left_word_box" style='flex-shrink:0;'>

                                      <span class='line_header_18' >金豆 (共{{hasGoldCount}}个,本单最高可用<span style='color:red;'>{{parseInt((carl_total_price - allTotalNoJoinVipPrice)*fyproBenefitItemRate*100)}}</span>)</span>
                                  </div>

                                  <div class="table_num_box input_par" style='width:100%;'>
                                      <!-- height为43不是41，因为有上下两边框，各为1" -->
                                      <!-- <a-input-number
                                      :precision="0"
                                      :max="inputGoldMax"
                                      v-model="inputGoldCountChange"
                                                              :disabled='(currentVoucherIndex==-1&&currentVipIndex==-1)?false:true'
                                      style="flex:auto;margin-right:6px;height:43px;"
                                      placeholder="请输入金豆"
                                      /> -->
                                      <input  placeholder="请输入金豆" type="text" ref="keyboard2" style='width:100%;' class='input_class' v-model="inputGoldCountChange" @focus="onFocus2">

                                  </div>

                              </div>



                              <div class="margin_fill" style='padding:0 10px 15px 10px;border-bottom:1px solid #f2f2f2;flex-direction:column;align-items:start;'  >  
                              <div class="left_word_box" style='flex-shrink:0;'>

                                  <span class='line_header_18'>会员折扣</span>
                              </div>

                              <div class="table_num_box" v-if='useVipDiscountList.length'>
                                  <div v-for="(item,index) in useVipDiscountList" :key="index"  :class='currentVipIndex==index?"select_normal_item":"un_select_normal_item"' @click="selectVipFunc(index,item)">
                                      <span >  {{(item.name*10).toFixed(1)}}折</span>
                                  <span  v-if='currentVipIndex==index' style='position:absolute;right:0;bottom:0;right:-3px;bottom:-8px;' class="iconfont icon-jiaobiaoxuanzhong right_check"></span>
                                  
                                  </div>

                              </div>
                              <div class="table_num_box"  v-if='!useVipDiscountList.length'>
                                      暂无会员折扣

                                  </div>



                              </div>

                              <div v-if='manDiscountFlag==1' class="margin_fill" style='padding:0 10px 15px 10px;border-bottom:1px solid #f2f2f2;flex-direction:column;align-items:start;'  >  
                                  <div class="left_word_box" style='flex-shrink:0;'>

                                      <span class='line_header_18' >人工减免</span>
                                  </div>

                                  <div class="table_num_box input_par" style='width:100%;'>
                                    <!-- 不与任何冲突，所有优惠计算完毕之后，再在应付金额后面减免 -->
                                      <a-input-number
                                      :precision="0"
                                
                                      v-model="manDiscountAmount"
                                            
                                      style="flex:auto;margin-right:6px;height:43px;"
                                      placeholder="请输入减免金额"
                                      />

                                  </div>

                              </div>
                              <div class="margin_fill" style='padding:0 10px 15px 10px;border-bottom:1px solid #f2f2f2;flex-direction:column;align-items:start;'  >  
                              <div class="left_word_box" style='flex-shrink:0;'>

                                  <span class='line_header_18'>支付方式</span>
                              </div>

                              <div class="table_num_box">
                                  <div v-for="(item,index) in payMethodsList" :key="index"  :class='currenPayMethodsIndex==index?"select_normal_item":"un_select_normal_item"' @click="selectPayMethodsFunc(index,item)">
                                      <span >{{item.payTypeName}}</span>
                                  <span  v-if='currenPayMethodsIndex==index' style='position:absolute;right:0;bottom:0;right:-3px;bottom:-8px;' class="iconfont icon-jiaobiaoxuanzhong right_check"></span>
                                  
                                  </div>

                              </div>



                              </div>
                              <div class="margin_fill" style='padding:0 10px 15px 10px;border-bottom:1px solid #f2f2f2;flex-direction:column;align-items:start;' v-if="payMethods==6||payMethods==7">  

                              <div class="left_word_box" style='flex-shrink:0;'>

                                  <span class='line_header_18'>用户付款码标识<span class="require_fill_star">*</span></span>
                                  </div>
                              <a-textarea  class='textarea_bg' ref='authCodeName' style="width: 100%;" placeholder="请用扫码枪扫用户付款码,注意务必将鼠标光标置于该输入框内,并处于闪烁状态" allow-clear v-model="authCodeChange"
                                  />
                                  <!-- <input ref='authCodeName' style="width: 530px" placeholder="请用扫码枪扫用户付款码,注意务必将鼠标光标置于该输入框内,并处于闪烁状态" allow-clear v-model="authCodeChange"
                                  /> -->
                              </div>


                                  <div class="margin_fill" style='padding:0 10px 15px 10px;border-bottom:1px solid #f2f2f2;flex-direction:column;align-items:start;' v-if="payMethods==5">  
                                      <div class="left_word_box" style='flex-shrink:0;'>

<span class='line_header_18'>其他方式<span class="require_fill_star">*</span></span>
</div>
                              <a-textarea style="width: 100%;" placeholder="请输入具体方式" allow-clear v-model="cusPayMethods"
                                  />
                              </div>


                      
                      
                                          
                        

                          
                          </div>
                          <div class="add_content_right_box" >     

                              <div class='right_top_box'>
                                  <div class='margin_fill'>
                                      <!-- <span class='width_138'> 用户信息</span> -->
                                      <div class="check_left" >
                                          <div>
                                              <img
                                                  style="width: 50px; height: 50px; border-radius: 25px"
                                                  :src="currentUserInfo.user.headImgurl"
                                                  alt=""
                                              />
                                          </div>

                                          <div style="margin-left: 16px">
                                          <div style="display: flex">
                                              <span class='color_999'>姓名：</span>
                                              <span class='color_000' style="font-weight: 700">{{ currentUserInfo.user.username }}</span>
                                          </div>
                                          <div style="display: flex">
                                              <span class='color_999'>手机：</span>
                                              <span class='color_000' style="font-weight: 700">{{ currentUserInfo.user.phone }}</span>
                                          </div>
                                          </div>
                                      </div>
                                      
                                  </div>

                                  <div class='margin_fill ' style='margin:10px 0 0 0 ;'>
                                      <span class='width_138 color_999' >订单金额:</span>
                                      <span   style="color:#1a1a1a;font-size:18px;">¥ {{carl_total_price.toFixed(2)}}</span>
                                  </div>
                                  <div class='margin_fill ' style='margin:10px 0 0 0 ;'>
                                      <span class='width_138 color_999' >优惠券抵扣:</span>
                                      <span   style="color:#c1272d;font-size:18px;">¥ {{currentDiscountMoney}}</span>
                                  </div>
                                  <div class='margin_fill '  style='margin:10px 0 0 0 ;'>
                                      <span class='width_138 color_999'>金豆抵扣:</span>
                                      <span   style="color:#c1272d;font-size:18px;">¥ {{inputGoldCount/100}}</span>
                                  </div>
                                  <div class='margin_fill ' style='margin:10px 0 0 0 ;'>
                                      <span class='width_138 color_999'>会员折扣:</span>
                                      <span   style="color:#c1272d;font-size:18px;">¥ {{((1-currentCardRate)*carl_total_price).toFixed(2)}}</span>
                                  </div>
                                  <div class='margin_fill ' style='margin:10px 0 0 0 ;' v-if='manDiscountFlag==1'>
                                      <span class='width_138 color_999'>人工减免:</span>
                                      <span   style="color:#c1272d;font-size:18px;">¥ {{manDiscountAmount}}</span>
                                  </div>
                                  <div class='margin_fill'  style='color:#c1272d;margin-top:30px;'> 
                                  <span class='width_138 '> 应付金额:</span>
                                  <span   style="font-size:22px;font-weight:bold">¥ {{(carl_total_price - manDiscountAmount - currentDiscountMoney - inputGoldCount/100 - (1 - currentCardRate)*carl_total_price).toFixed(2)}}</span>    
                              </div> 

                              </div>
                              
                              <!-- add_guide_bottom -->
                              <div class="toast_choice">
                                <div class='choice_cancel' @click="closeGuideBtnClick">
                                      取消
                                  </div>
                                  <div class='choice_sure'  @click="finalDealFunc()">
                                      确认
                                  </div>

 
                          
                          </div>
                      </div>
                      </div>
                    

                     
    </div>




  </div>




    <!-- @touchmove.prevent
      @mousewheel.prevent -->
    <div
      class="toast_box"
      v-if="orderShow"
      @click.self="hide"
    
    >
      <div class="card_info_toast_box">
      <div>
        <div class="card_info_top">
          <span style="font-size:16px;font-weight:700;">订单列表</span>
          <span @click="closeOrderBtnClick"><a-icon type="close"/></span>
        </div>
        <!-- :style="{height:currentScreenHeight*0.72+'px'}" -->
        <div class="card_info_bottom" :style="{height:currentScreenHeight*0.72+'px'}">
         

          
              <!-- <ul class='order_ul' style='overflow: scroll;'>
                <li class='order_li' style='background:#fafafa;'>
             
                   <div>序号</div>

                   <div style='flex:2'>下单时间</div>
                   <div>用户</div>           
                   <div>金额</div>
                   <div>收银员</div>
                   <div>操作</div>
                </li>
        
                <li v-for="(item,index) in allOrderList" :key='index' class='order_li'  >
   

                        
                    <div>{{index+1}}</div>    
                    <div  style='flex:2'>{{item.createTime | formatDate}}</div>
              
                  
                   <div>{{item.receiverPhone}}</div>
                   <div>{{item.originalPayment}}</div>
                   <div>-</div>
                   <div  class="red-1">
                    <a-space>
                    
                        
                    
                        <a-popconfirm
                        title="设置退款?"
                        ok-text="确认"
                        cancel-text="取消"
                        @confirm="refundFunc(item)"
                        @cancel="cancelSetting"
                        >
                        <a-button  v-if="item.postType==4&&item.status==5">退款</a-button>
                        </a-popconfirm>
                    
                    </a-space>
                    </div>

                   
                </li>
              </ul> -->
      


              <!-- :pagination="ticketPagination" -->
        <a-table
    
        :columns="ordercolumns"
        :data-source="allOrderList"
        rowKey="id"
        :pagination="false"
      >
        <div slot="btns" slot-scope="text,record" class="red-1">
          <a-space>
          
            
        
            <a-popconfirm
              title="设置退款?"
              ok-text="确认"
              cancel-text="取消"
              @confirm="refundFunc(record)"
              @cancel="cancelSetting"
            >
            <a-button  v-if="record.payment!=0 &&record.postType==4&&record.status==5">退款</a-button>
            </a-popconfirm>
          
          </a-space>
        </div>

        <span slot="indexNum" slot-scope="text, record, index">
  {{index+1}}
</span>
        <div slot="createTime"  slot-scope="text, record" >
           <span>{{ record.createTime | formatDate }}</span>
        </div>

        <div slot="mainFlag"  slot-scope="text, record" >
           <span v-if='record.mainFlag==1'>主打印机(打印全部商品)</span>
           <span v-if='record.mainFlag==2'>分打印机(需要绑定商品)</span>
           <span v-if='!record.mainFlag'>未设置</span>
        </div>
        


      </a-table> 

     

    </div>
    <a-pagination
      :total="ticketPagination.total"
      :show-total="total => `共 ${ticketPagination.total} 条数据`"
      :page-size="10"
      :default-current="1"
      @change="changeFunc"
      show-quick-jumper
    />

      </div>
    </div>

</div>


    <div  class="bottom_ope_box" >
            <div class="bottom_left_box" >
                  
                <div class='shop_ca_b' v-if="car_total_count">
                            
                             <div class="car_cal_price" style='width:100%;padding:0 20px;background:white;'>
                                <div class="total_box">
                                    <span >共计({{car_total_count}}个商品)</span>
                                
                                </div>
                                <div class="total_box">
                                
                                    <div>

                                        <span> 合计 (CNY)：</span>

                                        <span   style="color:#C1272D;font-size:24px;">¥ {{carl_total_price.toFixed(2)}}</span>
                                    </div>
                                </div>

                            </div>

                </div>

                <div class='shop_ca_b'  v-else>
                    <div class="car_cal_price" style='border:none;width:100%;padding:0 20px;background:white;'>

                    </div>
                    </div>

     
                <div  class='shop_ca_b'>
                  <div  style="
                        width: 127px;
                        height: 60px;
                        font-size: 18px;
                        background-color: #1F58BC;
                        border:1px solid #1F58BC;
                        font-size: 14px;
                        flex:1;
                        display:flex;align-items:center;justify-content:center;color:white;
                    " @click="clearClick">
                    清空
                            </div>
                        <div style="
                        width: 127px;
                        height: 60px;
                        font-size: 18px;
                        border:1px solid #ED6A1F;
                        background-color: #ED6A1F;
                        font-size: 14px;
                        flex:1; display:flex;align-items:center;justify-content:center;color:white;
                    " @click="submitClick">
                    下一步
                            </div>
                    </div>

             </div>
            <div class="bottom_right_box" >
                <div style='background:transparent;'>
                
                </div>

                <div class='right_oprt'>
                    <div class='ope_b'   @click="orderClick">

                        <span class='iconfont icon-dingdan' style='font-size:24px;'></span>
                        <span class='text-op'>订单</span>
                    </div>
                    <div class='bottom_right_ope'>
                        <div @click="changeStore" class='ope_b' >
                            
                            <span class='iconfont icon-jiantou_zuoyouqiehuan_o' style='font-size:24px;'></span>
                            <span class='text-op'>切换店铺</span>
                            </div>
                        <div class='ope_b' style='margin:30px;'>
                            <span class='iconfont icon-geren2' style='font-size:24px;'></span>
                            <span class='text-op'>{{userName}}</span>
                        </div>
                        <div  class='ope_b'  @click="quitFunc">
                            <span class='iconfont icon-tuichu2' style='font-size:24px;'></span>
                            <span class='text-op'>退出登录</span>
                        </div>
                    </div>       
                
                </div>
                
            </div>
</div>




</div>

<!-- </a-layout-content> -->
</template>

<script>
// import $ from "jquery";

// import vueSeamlessScroll from 'vue-seamless-scroll/src';
import { formatDate } from "../utils/transformTime.js";
import imggroup from './imggroup.vue'
import {
    updateItemNumAPI,
   getStorePayTypeListAPI,
     GETSTOREINFOAPI,
     getStoreBindPhoneListAPI, // 获取店铺绑定手机号列表
     getStoreClassifyListAndItemForEatPCAPI,
     getStoreDeskListForOrderAPI,
     getUserAssetsGoldAPI, // 获取用户金豆
     saveRechargeAPI,
     storeWebCashierAPI,
     wxBTOCPayForAnnualCardAPI,
     
     getAllCardListForStoreWebCaisherAPI,
     deleteStoreBindPhoneAPI,
     getStoreAndBranchInfoAPI,
     wxBTOCPayForGoodsAPI,
     aliPayBTOCForGoodsAPI,
     getAllCardItemListForOneStoreAppletsAPI,
     addStoreBindPhoneAPI,
     checkIsBuyStoreAnnualCardAPI,
     checkUserAPI,
     getCardListAPI,
     getOrderListNewAPI,
     orderRefundForStoreAPI,

 } from "../api/index.js";
import axios from "axios";
import qs from 'qs';
import { mapGetters } from "vuex";
// import KeyInput from "./KeyInput.vue"
// import Keyboard from './Keyboard.vue'
import Keyboard from './KeyboardModify.vue'

import ModifyStock from "./modifyStock.vue";
// const { ipcRenderer } = window.require("electron")
// import {ipcRenderer} from 'electron'
import { ipcRenderer } from 'electron'
function getBase64(img, callback) {
    const reader = new FileReader();
    reader.addEventListener("load", () => callback(reader.result));
    reader.readAsDataURL(img);
}



export default {


    data() {
        return {
            openStockShow:false,
            childItemId:0,
            currentSkuId: '',
            currentSkuPrice: '',
            stockSkuList: [],
           


            logoPosition: {
        x: window.innerWidth - 200,
        y: window.innerHeight - 200,
      },
      isDragging: false,
      initialTouchPos: { x: 0, y: 0 },

            yearAndMonthAndDay:'',
            keyboards:"",
             headImgUrl:'',
            option: {
                type:1,
          show: false,
          sourceDom: ''
        }, 
        option2: {
            type:2,
          show: false,
          sourceDom: ''
        },
            nowDate: null,
      nowtimer: "",

      storeName:"",
      totalPage:0,
            currentScreenHeight:1000,
            ticketPagination: {
          // 全部商品页码监听
          defaultCurrent: 1, // 默认当前页数
          // defaultPageSize: 5, // 默认当前页显示数据的大小
          total: 0, // 总数，必须先有
          // showSizeChanger: true,
          showQuickJumper: true,
          // pageSizeOptions: ["5", "10", "15", "20"],
          showTotal: total => `共 ${total} 条`,
          onShowSizeChange: (current, pageSize) => {
            this.ticketPagination.defaultCurrent = 1;
            this.ticketPagination.defaultPageSize = pageSize;
            this.orderListFunc(1); // 获取数据
          },
          // 改变每页数量时更新显示
          onChange: (current, size) => {
            this.ticketPagination.defaultCurrent = current;
            this.ticketPagination.defaultPageSize = size;
            this.orderListFunc(current);
          }
        },

        // 序号 下单时间 用户 金额 收银员 操作
            ordercolumns: [
      
        {
          title: '序号',
          dataIndex: 'indexNum',  	
          ellipsis: false,
          scopedSlots: {
            customRender: 'indexNum',
          },
        },
       
        {
          title: '下单时间',
          key: 'createTime',
          dataIndex: 'createTime',
          ellipsis: false,
          	scopedSlots: {
            customRender: 'createTime',
          },
        },
        {
          title: '用户',
          key: 'receiverPhone',
          dataIndex: 'receiverPhone',
          ellipsis: false,
        },
        

        {
          title: '金额',
          key: 'originalPayment',
          dataIndex: 'originalPayment',
          ellipsis: false,
        },
        {
          title: '付款渠道',
          key: 'invitationCode',
          dataIndex: 'invitationCode',
          ellipsis: false,
        },
        
        {
          title: '收银员',
          key: 'checkUserName',
          dataIndex: 'checkUserName',
          ellipsis: false,
        },
        {
          title: '操作',
          key: '7',
          dataIndex: 'companyName',
          scopedSlots: {
            customRender: 'btns',
          },
        },
      ],
      allOrderList:[],
            orderShow:false,
            userName:{},
            stockShow:false,
            currentStockJson:{},
            stockNum:0,

            manDiscountFlag:'',// 1人工减免开启状态  0人工减免关闭状态
            allTotalNoJoinVipPrice:0,
            cardNo:"",
       cardPassword:"",
            goldExchangeShow:false,
            manDiscountAmount:0,
            currentGuideWeight: 0,
            currentGuideCount: 0,
            guideInputCount: 0,
            currentUnitFlag: '', // 当前商品对应的是按重量还是按数量
            currentRadioIndex: -1,
            currentRadioChecked: false,
            openVipAuthCodeChange: '',
            payMethodsList:[],



            
            buyCardPayList: [{ id: 1, name: '微信收款码' },
                // { id: 16, name: '现金' }
            ],
            buyCardId: '',
            addCouponWidth: 1180,
            onlineData: [],

            columns: [{
                    title: "购买状态",
                    dataIndex: "buyFlag",
                    key: "buyFlag",
                    // width: 120,
                    ellipsis: false, // 换行
                    scopedSlots: { customRender: "buyFlag" }
                },
                {
                    title: "会员卡名称",
                    dataIndex: "name",
                    key: "name",
                    // width: 120,
                    ellipsis: false // 换行
                },

                {
                    title: "时间",
                    dataIndex: "createTime",
                    key: "createTime",
                    ellipsis: false,
                    scopedSlots: { customRender: "timeTransform" }
                },
                {
                    title: "有效期(月)",
                    dataIndex: "validMonth",
                    key: "validMonth",
                    // scopedSlots: { customRender: "timeTransform" },
                    ellipsis: false // 换行
                },
                {
                    title: "状态",
                    dataIndex: "status",
                    key: "status",
                    scopedSlots: { customRender: "status" },
                    ellipsis: false
                },
                {
                    title: "售价(元)",
                    dataIndex: "cardPrice",
                    key: "cardPrice",
                    ellipsis: false
                },
                {
                    title: "支付折扣",
                    dataIndex: "payRate",
                    key: "payRate",
                    scopedSlots: { customRender: "payRate" },
                    ellipsis: false
                },
                // {
                //   title: "总销量",
                //   dataIndex: "totalSaleNum",
                //   key: "totalSaleNum",
                //   ellipsis: true
                // },
                // {
                //   title: "线上销售",
                //   dataIndex: "onlineSaleNum",
                //   key: "onlineSaleNum",
                //   ellipsis: false
                // },
                // {
                //   title: "激活数量",
                //   dataIndex: "offlineSaleNum",
                //   key: "offlineSaleNum",
                //   ellipsis: false
                // },

            ],

            allCardList: [],
            buyShow: false,
            showBuyBtn: false,
            useVipDiscount: undefined, // 0不使用会员
            // useVipDiscountList:[{name:'使用',id:1,},{name:'不使用',id:0}],
            useVipDiscountList: [],
            cardVipJson: {},
            hasProfitData: false, // 是会员
            inputGoldMax: 1000000000,
            // payRate:0.5,
            hasGoldCount: '',
            inputGoldCountChange: '',
            inputGoldCount: '',
            submitShow: false,
            // cateaaa:[{name:'111'},{name:'订单大幅度发'},{name:'订单大幅度发'},{name:'订单大幅度发'},{name:'434434343'},{name:'65665'},{name:'3454'},{name:'545435'},{name:'654654645'},{name:'76756'},{name:'88888'},{name:'非官方个公分'},{name:'33434345465465'}],
            currentIndex: 0,
            authCodeChange: '',
            authCode: '',
            weightChange: '',
            weight: '',
            oftenText: '设为常用',
            currentTableNumIndex: -1,
            currentEatMethodsIndex: 0,
            currentCardSelectIndex: 1,
            currentOftenUseIndex: -1,
            currentVoucherIndex: -1,
            currenPayMethodsIndex: -1,
            currentBuyCardIndex: 0,
            currentBuyCardPayId: 1,
            currentVipIndex: -1,
            getOftenList: [
                // {id:1,mobile:13333333333},{id:2,mobile:14444444444},{id:3,mobile:15555555555},{id:4,mobile:16666666666}
            ],
            buyCardSelectList: [
                { id: 1, name: '购买' }, { id: 0, name: '暂不购买' }
            ],
            eatMethodsList: [
                { id: 3, name: '堂食' }, { id: 4, name: '外带' }
            ],

           


            // payMethodsList: [{ id: 1, name: '收款码' }, { id: 6, name: '微信付款码' }, { id: 3, name: '美团' }, { id: 4, name: '抖音' }, { id: 5, name: '其他（须填写具体方式）' }],
            // payMethodsList: [{ id: 6, name: '微信付款码' }, { id: 3, name: '美团' }, { id: 4, name: '抖音' }, { id: 5, name: '其他（须填写具体方式）' }],
            fyproBenefitItemRate: 0, // 金豆折扣
            currentCardRate: 1, // 会员卡折扣
            currentDiscountMoney: 0.00,
            currentLevel1: '',
            currentLevel2: '',
            tempMealList: [],
            tempCurrentAttributeList: [],
            currentAttributeList: [],
            addGuideShow: false,

            storeDeskId: undefined,
            tableNumList: [],
            sureUseSelectPhone: false,
            addShow: false,
            cardPayStatus: 0, // 1用户支付了会员卡  0用户未支付会员卡车
            currentUserSelect: false,
            currentUserInfo: {},
            couponList: [],
            cardTypeList: [],
            couponType: undefined, // 0不使用优惠券
            cardType: undefined,
            payMethods: undefined,
            payMethodsText: '',
            cusPayMethods: '',
            telephone: '', //18663268160
            eatMethodsType: 3,
            car_total_count: 0,
            temp_car_total_count: 0,
            carl_total_price: 0.00,
            onlyShopTotalPrice: 0.00,
            mealList: [
                //   {cate:'面条',itemList:[{id:1,name:'黄花牛肉面',price:'12.00',image:'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/meat/f1.jpg'},{id:2,name:'精品黄花面',price:'18.00',image:'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/meat/f2.jpg'}]},
                //   {cate:'凉菜',itemList:[{id:3,name:'凉拌干丝',price:'6.00',image:'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/meat/f3.jpg'},{id:4,name:'凉拌海带丝',price:'8.00',image:'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/meat/f4.jpg'},{id:5,name:'凉拌黄花菜',price:'13.00',image:'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/meat/f5.jpg'}]},
                //   {cate:'饮品',itemList:[{id:6,name:'热豆浆',price:'3.00',image:'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/meat/f6.jpg'},{id:7,name:'冰豆浆',price:'4.00',image:'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/meat/f7.jpg'},{id:6,name:'甜豆浆',price:'13.00',image:'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/meat/f8.jpg'},{id:5,name:'辣豆浆',price:'13.00',image:'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/meat/f8.jpg'},{id:10,name:'咸豆浆',price:'13.00',image:'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/meat/f8.jpg'},{id:11,name:'苦豆浆',price:'13.00',image:'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/meat/f8.jpg'}]}
            ],




            frequentlyToastShow: false,
            toastHide: null,
            // selectedRows: [],
            // selectedRowKeys: [],

        };
    },
    filters: {
        formatDate(time) {
            // time = time * 1000;
            let date = new Date(time);
            // console.log(new Date(time));
            return formatDate(date, "yyyy-MM-dd  hh:mm");
        }
    },
    computed: {
        ...mapGetters(["cbStoreId", "cbStoreInfo", "cbUserId", "cbToken","cbUserInfo","cbUserPhone"]),
        //     rowSelection() {
        //   return {
        //     type: "radio", //单选按钮定义
        //     onChange: (selectedRowKeys, selectedRows) => {
        //       console.log(selectedRowKeys, selectedRows);
        //       this.selectedRowKeys = selectedRowKeys;
        //       this.selectedRows = selectedRows;
        //     },
        //     // selectedRowKeys: selectedRowKeys,
        //     getCheckboxProps: (record) => ({
        //       props: {
        //         defaultChecked: record.buyFlag ===1? true:false,
        //         disabled: record.buyFlag === 1,
        //         name: record.name,
        //         value:record.buyFlag ===1? true:false,

        //       },
        //     }),
        //   };
        // },
        
        dealTableNumList() {
            return this.tableNumList.reverse();
        }
    },

    components: {
        imggroup,
        Keyboard,
        ModifyStock
        // vueSeamlessScroll
    },
    watch: {
        inputGoldCountChange(newVal, oldVal) {

            this.inputGoldCount = newVal;
            console.log('---inputGoldCountChange-', newVal);
            this.manDiscountAmount = 0;
            // if ((this.carl_total_price - this.currentDiscountMoney)*this.payRate <this.inputGoldCount) {
            //     var text = '最大输入金豆为' + (this.carl_total_price - this.currentDiscountMoney)*this.payRate;
            //     this.inputGoldCount = 0;
            //     this.inputGoldCountChange = 0;
            //     this.$message.warning(text);
            //     // this.submitClick();
            // } else {

            // }

            if ((this.carl_total_price - this.allTotalNoJoinVipPrice) * this.fyproBenefitItemRate * 100 < this.inputGoldCount) {
                console.log('超出了---');
                this.inputGoldCountChange = '';
            }
            // inputGoldMax
        },
        manDiscountAmount(newVal, oldVal) {

            // this.inputGoldCount = newVal;
            console.log('---inputGoldCount-', newVal);
            // if ((this.carl_total_price - this.currentDiscountMoney)*this.payRate <this.inputGoldCount) {
            //     var text = '最大输入金豆为' + (this.carl_total_price - this.currentDiscountMoney)*this.payRate;
            //     this.inputGoldCount = 0;
            //     this.inputGoldCountChange = 0;
            //     this.$message.warning(text);
            //     // this.submitClick();
            // } else {

            // }

            if((this.carl_total_price - newVal - this.currentDiscountMoney - this.inputGoldCount/100 - (1 - this.currentCardRate)*this.carl_total_price).toFixed(2)<0){
                console.log('超出了---');
                this.manDiscountAmount = 0;
               
            }




            // if ((this.carl_total_price - this.allTotalNoJoinVipPrice) * this.fyproBenefitItemRate * 100 < this.inputGoldCount) {
            //     console.log('超出了---');
            //     this.inputGoldCountChange = '';
            // }
            // inputGoldMax
            },
        
        weightChange(curVal, oldVal) {
            console.log('22----', curVal);
            // this.mealList[level1].itemList[level2].count = this.mealList[level1].itemList[level2].tempCount;
            this.mealList[this.currentLevel1].itemList[this.currentLevel2].tempWeight = curVal;
        },
        // weightChange(curVal, oldVal) {
        //     console.log('22----', curVal);
        //     this.weight = curVal;
        //     if (this.weight.length==11) {
        //       console.log('自动支付');
        //         // this.submitClick();
        //     } else {

        //     }
        // },
        openVipAuthCodeChange(curVal, oldVal) {
          
            this.authCode = curVal;
            console.log('22----', this.authCode,'长度----',this.authCode.length);
            if (this.authCode.length == 18) {
                this.handleOk();
            } else {

            }
        },
        authCodeChange(curVal, oldVal) {
            console.log('22----', curVal);
            this.authCode = curVal;
            if (this.authCode) {
                // this.submitClick();
            } else {

            }
        }
    },

    methods: {
        closeStockDeal:function (data) {
   
   console.log("closeStockDeal====",data,'---',typeof(data));
   this.openStockShow = false;
   if(data.stockNum==0||data.oldStock==0){
     console.log('之前有库存为0的数据，获取真实的商品列表');
     this.getmealListFunc();
   }

 },

        stockShowFunc(index1, index2, item2) {

if (!this.sureUseSelectPhone) {
    return this.$message.warning('请先选择用户');
}
console.log('ce-----', this.mealList[index1].itemList[index2]);
console.log('重量ff--', this.mealList[index1].itemList[index2].weight, '===unitFlag=-', parseInt(this.mealList[index1].itemList[index2].unitFlag));
console.log('iaaaaatems---', item2);
if (this.mealList[index1].itemList[index2].surplusUse <= 0) {
    console.log('权益次数为0');
    this.$message.warning("该商品剩余权益次数为0");
    return;
}
// if (this.mealList[index1].itemList[index2].num == 0 && parseInt(this.mealList[index1].itemList[index2].unitFlag) == 1) {
//     console.log('数量--售罄---不弹框');
//     this.$message.warning("已售完,请补充库存！");
//     return;
// }


// if (this.mealList[index1].itemList[index2].weight == 0 && parseInt(this.mealList[index1].itemList[index2].unitFlag) == 2) {
//     console.log('重量--售罄---不弹框');
//     this.$message.warning("已售完,请补充库存！");
//     return;
// }
this.childItemId = parseInt(item2.id);

console.log('外层childItemId---',this.childItemId);
this.openStockShow = true;
console.log('openStockShow---',this.openStockShow);


},


        selectYearAndMonthAndDay() {
        var nowDate = new Date();
        var Year = nowDate.getFullYear();
        var Month =
          nowDate.getMonth() + 1 < 10
            ? "0" + (nowDate.getMonth() + 1)
            : nowDate.getMonth() + 1;
        var Day =
          nowDate.getDate() < 10 ? "0" + nowDate.getDate() : nowDate.getDate();
       this.yearAndMonthAndDay = Year + "/" + Month + "/" + Day;
        console.log('年月日---',this.yearAndMonthAndDay); 
      },
        GetKeyVal(val){
           this.keyboards=val; 
           console.log('keyboards===',this.keyboards);
       } ,
      rightTopClick(type){
        if(type==1){
            ipcRenderer.send('min') // 通知主进程我要进行窗口最小化操作
        }else if(type==2){
            ipcRenderer.send('max')
        }else if(type==3){
            ipcRenderer.send("close") // 通知主进程 关闭
        }
      
           

         
      },
        changeFunc(current, pageSize) {
    //   this.dealFinishOrderCurrentPage = current;
    //   console.log("已完成订单当前页码", this.dealFinishOrderCurrentPage);
      console.log("~~~~~~~", pageSize);
      this.orderListFunc(current);
    },

        //   minFunc(){
        //     console.log('最小化点击');
        //     // ipcRenderer.send("close") // 通知主进程 关闭
        //   },
        //   maxFunc(){
        //     console.log('最大化点击');
        //   },

        changeStore(){
      this.$router.replace("/selectStore");
    },
        getInputValue(val) {
            console.log('fffffffv==',val);
        if(val === 'delete'||val === ''){
          this.telephone = this.telephone.slice(0,this.telephone.length -1)
        }else{
        //   this.telephone += val
        // this.telephone = this.telephone + ''+ val
        this.telephone = this.telephone.concat(val);
        }
      },
      getInputValue2(val) {
            console.log('gggfffffffv==',val);
        if(val === 'delete'||val === ''){
          this.inputGoldCountChange = this.inputGoldCountChange.slice(0,this.inputGoldCountChange.length -1)
        }else{
        //   this.telephone += val
        // this.telephone = this.telephone + ''+ val
        this.inputGoldCountChange = this.inputGoldCountChange.concat(val);
        }
      },
      onFocus2() {
        this.$set(this.option2, 'show', true)
        this.$set(this.option2, 'sourceDom', this.$refs['keyboard2'])
      },
      onFocus() {
        this.$set(this.option, 'show', true)
        this.$set(this.option, 'sourceDom', this.$refs['keyboard'])
      },

  
        cancelSetting(){
      console.log('取消v 设置---');
    },
        gettime() {
      this.nowDate = new Date().toLocaleString();
    },
        refundFunc(item){
      
    //   var json = JSON.parse(this.cbStoreInfo);
    //   if (!json) {
    //     this.$router.replace("/login");
    //     return;
    //   }

    //   var jsonParams = {
    //     orderId: this.orderId,
    //     storeId: this.cbStoreId,
    //   };
    //   console.log('----json==',jsonParams);
     
    //   orderRefundForStoreAPI(jsonParams).then((res) => {
    //     console.log("res为", res);
    //     if (res.status != 200) {
    //       this.$message.warning(res.msg);
    //       return;
    //     }
    //     this.$message.success('操作成功');
    //     this.orderDetailFunc();

    //   });

      var jsonParams = {
        storeId: this.cbStoreId,
        userId: this.cbUserId,
        token: this.cbToken,
        orderId:item.id,

      };
      console.log('json-=-',jsonParams);

      this.$http
          .post(
            this.globalRequestUrl.orderRefundForStoreAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            if (res.data.status == 200) {
              console.log("orderRefundForStoreAPI---", res);
                this.orderListFunc(1);
               this.$message.success('操作成功');
            
            } else {
              this.$message.error(res.data.msg);
            }
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });



    },

        quitFunc() {
           
        var userPhone = this.cbUserPhone;
        window.localStorage.clear();
        this.$store.commit("setCbUserPhone", userPhone);   // 记住上次手机号
        this.$router.replace("/login");

      },
  
        orderClick(){
            console.log('ffggg===');
            this.orderListFunc(1);
      
        },
        closeOrderBtnClick(){
            this.orderShow = false;
        },
       
        bottomScrollClick() {
      this.$nextTick(() => {
        let scrollEl = this.$refs.left_scroll;
        scrollEl.scrollTo({ top: scrollEl.scrollHeight, behavior: 'smooth' });
      });
},

shopItemClick(index1, index2, item2) {
            console.log('item2---', item2);
            if (!this.sureUseSelectPhone) {
                return this.$message.warning('请先选择用户');
            }
            console.log('ce-----', this.mealList[index1].itemList[index2]);
            console.log('重量ff--', this.mealList[index1].itemList[index2].weight, '===unitFlag=-', parseInt(this.mealList[index1].itemList[index2].unitFlag));
            console.log('items---', item2);
            if (this.mealList[index1].itemList[index2].surplusUse <= 0) {
                console.log('权益次数为0');
                this.$message.warning("该商品剩余权益次数为0");
                return;
            }
            if (this.mealList[index1].itemList[index2].num == 0 && parseInt(this.mealList[index1].itemList[index2].unitFlag) == 1) {
                console.log('数量--售罄---不弹框');
                this.$message.warning("已售完,请补充库存！");
                return;
            }


            if (this.mealList[index1].itemList[index2].weight == 0 && parseInt(this.mealList[index1].itemList[index2].unitFlag) == 2) {
                console.log('重量--售罄---不弹框');
                this.$message.warning("已售完,请补充库存！");
                return;
            }

            this.currentAttributeList = [];
            this.tempCurrentAttributeList = [];
            console.log('index1---', index1, '---index2---', index2, 'item2--', item2);

            this.currentLevel1 = index1;
            this.currentLevel2 = index2;
            console.log('aa---', this.currentLevel1, '--bb--', this.currentLevel2);
            console.log('item2.dishAttrList---', item2.dishAttrList);
            if (item2.dishAttrList != null && item2.num != 0 && item2.unitFlag == 1) {
                this.currentAttributeList = JSON.parse(JSON.stringify(this.mealList[index1].itemList[index2].dishAttrList));
                this.tempCurrentAttributeList = JSON.parse(JSON.stringify(this.mealList[index1].itemList[index2].dishAttrList));
                // console.log('currentAttributeList---',this.currentAttributeList);
                console.log('currentAttributeList', this.currentAttributeList, '-----tempCurrentAttributeList---', this.tempCurrentAttributeList);
            }
            if (item2.dishAttrList != null && item2.weight != 0 && item2.unitFlag == 2) {
                this.currentAttributeList = JSON.parse(JSON.stringify(this.mealList[index1].itemList[index2].dishAttrList));
                this.tempCurrentAttributeList = JSON.parse(JSON.stringify(this.mealList[index1].itemList[index2].dishAttrList));
                // console.log('currentAttributeList---',this.currentAttributeList);
                console.log('currentAttributeList', this.currentAttributeList, '-----tempCurrentAttributeList---', this.tempCurrentAttributeList);
            }


            console.log('当前商品的currentAttributeList---', this.currentAttributeList);
            this.currentGuideCount = 0;
            this.currentGuideWeight = 0;


            if (this.currentAttributeList[0].attrValueList.length > 1 || item2.unitFlag == 2) {
                console.log('有大于1个的规格==弹框');
                this.addGuideShow = true;
            } else {
                this.currentSkuPrice = item2.dishAttrList[0].attrValueList[0].price;
                this.currentSkuId = item2.dishAttrList[0].attrValueList[0].attrId;

                this.currentAttributeList[0].attrValueList[0].tempSelect = true;

                this.currentGuideCount = this.currentGuideCount + 1;

                console.log('ff===', this.mealList);

                if (this.mealList[index1].itemList[index2].differentGuideList.length) { // 之前存储过规格，直接累加1
                    console.log('afg');
                    this.addCarGuideMealFunc(index1, index2, 0);
                } else { // 之前没有存储规格
                    console.log('akd');
                    this.sureGuideBtn();
                }

            }


            // if (parseInt(item2.unitFlag) == 2) {
            //     this.$nextTick(() => {
            //         this.$refs.inputWeightRef.focus();
            //     })
            // }




        },


        sureStockModal(){
      console.log('库存---',this.stockNum);
      if(this.stockNum==null){
        return   this.$message.warning('请输入库存');
      }
      this.modifyStockFunc();
    },


    orderListFunc(page) {
    
        console.log('-g-g--',page);
      var jsonParams = {
        storeId: this.cbStoreId,
        userId: this.cbUserId,
        token: this.cbToken,
        pageNum: page,
        pageSize: 10,
        status: 0, // 状态  1出售中 2已下架
        startDate: this.yearAndMonthAndDay, // 开始时间
        endDate: this.yearAndMonthAndDay, // 结束时间
        title: "",
        orderNo: "",
        phone: "",
        couponName: "",

      };
      console.log('参数为',jsonParams);

     



            this.$http
          .post(
            this.globalRequestUrl.getOrderListNewAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            if (res.data.status == 200) {
              console.log("getOrderListNewAPI---", res);
           
              this.allOrderList = res.data.data.result_list;
              this.ticketPagination.total = res.data.data.totalData;
              this.totalPage = res.data.data.totalPage;
              if(page==1){
                this.orderShow = true;
              }
            } else {
              this.$message.error(res.data.msg);
            }
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });


    },




    modifyStockFunc() {
    
    //     var json = JSON.parse(this.cbStoreInfo);
    //   if (!json) {
    //     this.$router.replace("/login");
    //     return;
    //   }
      var jsonParams = {
        storeId: this.cbStoreId,
        userId: this.cbUserId,
                token: this.cbToken,
        itemId:this.currentStockJson.id,
        num:this.stockNum,
      };
      console.log('参数为',jsonParams);

     



            this.$http
          .post(
            this.globalRequestUrl.updateItemNumAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            if (res.data.status == 200) {
              console.log("updateItemNumAPI---", res);
           
               this.$message.success('修改成功');
                this.stockShow = false;
              

          this.mealList[this.currentLevel1].itemList[this.currentLevel2].num = this.stockNum;
            } else {
              this.$message.error(res.data.msg);
            }
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });


    },
 
        getStorePayTypeList(){
       

    //    var json = JSON.parse(this.cbStoreInfo);
    //      if (!json) {
    //        this.$router.replace("/login");
    //        return;
    //      }
         

           
            
           var jsonParams = {
                userId: this.cbUserId,
                token: this.cbToken,
                storeId: this.cbStoreId,
             };
            //  console.log('aa-dsd---',jsonParams);

            this.$http
          .post(
            this.globalRequestUrl.getStorePayTypeListAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            if (res.data.status == 200) {
            //   console.log("getStorePayTypeListAPI---", res);
              this.payMethodsList = [];
             this.payMethodsList = res.data.data;
             this.payMethodsList.unshift({
               payTypeName: "支付宝付款码",
                 id: 7,
               });

               this.payMethodsList.unshift({
               payTypeName: "微信付款码",
                 id: 6,
               });

          
            } else {
              this.$message.error(res.data.msg);
            }
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });

     },
        goldExchangeClick(item){
            console.log('item---',item);
        // this.currentItem = item;
        
        this.goldExchangeShow = true;
      },
        onSure(){
       
       if(!this.cardNo){
         this.$message.warning('请输入卡号');
         return;
       }
       if(!this.cardPassword){
         this.$message.warning('请输入密码');
         return;
       }


     
            
     var jsonParams = {
                userId: this.cbUserId,
                token: this.cbToken,
                cardNo:this.cardNo,
       cardPassword:this.cardPassword,
       rechargeUserId:this.currentUserInfo.user.id
             };
            //  console.log('aa-dsd---',jsonParams);

            this.$http
          .post(
            this.globalRequestUrl.saveRechargeAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            if (res.data.status == 200) {
              console.log("saveRechargeAPI---", res);
              this.goldExchangeShow = false;
       this.$message.success('操作成功');

          
            } else {
              this.$message.error(res.data.msg);
            }
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });

     },
        ticketMachineFunc() {
            this.$router.push("/ticketMachineList");
        },
        mealSettingFunc() {
            this.$router.push("/scanOrderMealList");
        },
        onRadioChange1(e) {
            console.log('radio checked', e.target.value);
            this.currentRadioChecked = !this.currentRadioChecked;
        },
        onRadioChange2(e) {
            console.log('radio checked', e);
            this.currentRadioIndex = e;
            this.currentRadioChecked = !this.currentRadioChecked;
        },
        chargeVipFunc() {
            this.requestFunc();

        },
        onCropperCancel() {
            console.log('关闭了----0');
            this.currentRadioIndex = -1;
            this.currentCardSelectIndex = 1;
            this.buyShow = false;
            //   this.selectedRowKeys = [];
            // this.selectedRows = [];

        },
        handleOk() {



            // if(!this.selectedRows.length){
            //     return this.$message.warning('请选择会员卡');
            // }
            console.log('fff====currentRadioIndex',this.currentRadioIndex);
            if (this.currentRadioIndex== -1) {
                return this.$message.warning('请选择会员卡');
            }
            if (this.currentBuyCardIndex == -1) {
                return this.$message.warning('请选择会员卡支付方式');
            }




            if (this.currentBuyCardPayId == 1 && !this.authCode) {
                return this.$message.warning('请用扫码枪扫用户付款码');
            }






            //  this.buyCardId =   this.onlineData[this.currentRadioIndex].id;
            if (this.currentBuyCardPayId == 16) { // 现金
                this.buyCardUseCashFunc();
            } else { //微信收款码
                this.buyCardUseWXFunc();
            }


        },
        buyCardUseCashFunc() {

            console.log(';fff===', this.onlineData[this.currentRadioIndex]);
        
            
            
            var jsonParams = {
                userId: this.cbUserId,
                token: this.cbToken,
                buyUserId: this.currentUserInfo.user.id,
                payType: this.currentBuyCardPayId,
                cardId: this.onlineData[this.currentRadioIndex].id,

             };
            //  console.log('aa-dsd---',jsonParams);

            this.$http
          .post(
            this.globalRequestUrl.storeWebCashierAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            if (res.data.status == 200) {
              console.log("storeWebCashierAPI---", res);
              this.buySunccessAndUpdateDataFunc();

          
            } else {
              this.$message.error(res.data.msg);
            }
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });

        },

        buyCardUseWXFunc() {


    


            
            
            var jsonParams = {
                userId: this.cbUserId,
                token: this.cbToken,
                cardId: this.onlineData[this.currentRadioIndex].id,
                authCode: this.authCode,
                buyUserId: this.currentUserInfo.user.id,
             };
             console.log('aa-dsd---',jsonParams);

            this.$http
          .post(
            this.globalRequestUrl.wxBTOCPayForAnnualCardAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            if (res.data.status == 200) {
              console.log("getStoreClassifyListAndItemForEatPCAPI---", res);
              this.buySunccessAndUpdateDataFunc();

          
            } else {
              this.$message.error(res.data.msg);
            }
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });



        },
        buySunccessAndUpdateDataFunc() {
            this.$message.success('购买成功');

            this.showBuyBtn = false;
            this.onCropperCancel();
            this.checkFunc(true);
        },



        requestFunc() {
            // var json = JSON.parse(window.localStorage.getItem("cbStoreInfo"));
            //  var json = JSON.parse(this.cbStoreInfo);
            // if (!json) {
            //   this.$router.replace("/login");
            //   return;
            // }


            var jsonParams = {
                userId: this.cbUserId,
                token: this.cbToken,
                storeId: this.cbStoreId,
                buyUserId: this.currentUserInfo.user.id,
             };

            //  console.log('aa-dsd---',jsonParams);

            this.$http
          .post(
            this.globalRequestUrl.getAllCardListForStoreWebCaisherAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            if (res.data.status == 200) {
            //   console.log("getStoreBindPhoneListAPI---", res);
              this.onlineData = res.data.data;
                this.buyShow = true;

          
            } else {
              this.$message.error(res.data.msg);
            }
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });




        },
        deleteGuideCarItem(index1, index2, index3) {
            console.log('删之前', this.mealList);
            console.log('111aaa删除点击--index1--', index1, '----index2', index2, '----index3', index3);
            // return;
            // this.mealList[index1].itemList[index2].count = 0;
            // this.mealList[index1].itemList[index2].tempCount = 0;

            // this.mealList = [...this.mealList];

            this.car_total_count = this.car_total_count - this.mealList[index1].itemList[index2].realDifferentGuideList[index3].guideCount;
            // this.mealList[index1].itemList[index2].realDifferentGuideList[index3].guideCount = 0;
            this.mealList[index1].itemList[index2].differentGuideList.splice(index3, 1);
            this.mealList[index1].itemList[index2].realDifferentGuideList.splice(index3, 1);

            this.mealList = [...this.mealList];

            console.log('222---mealList---', this.mealList);

            // 计算规格与非规格的总价
            this.calGuideTotalPriceFunc(index1, index1);


        },



        deleteCarItem(index1, index2) {
            console.log('删除点击--index1--', index1, '----index2', index2);
            this.car_total_count =    this.car_total_count - this.mealList[index1].itemList[index2].count;
            this.mealList[index1].itemList[index2].count = 0;
            this.mealList[index1].itemList[index2].tempCount = 0;
         
            this.mealList = [...this.mealList];


        },
        clearClick() {
            console.log('点击了清空');

            console.log(' this.mealList---', this.mealList);

            for (var i = 0; i < this.mealList.length; i++) {
                var item1 = this.mealList[i];
                for (var m = 0; m < item1.itemList.length; m++) {
                    var item2 = item1.itemList[m];
               
                    item2.count = 0;
                    item2.tempCount = 0;
                    item2.differentGuideList = [];
                    item2.realDifferentGuideList =[];
                 
                }
            }
            this.mealList = [...this.mealList];
            this.car_total_count = 0;
            this.currentGuideCount = 0;
            this.currentGuideWeight = 0;
            console.log('aaaaathis.mealLis---', this.mealList);

        },
        changeInputGoldCount(e) {
            this.currentInputGold = e.detail.value;
            console.log('实时监听输入金豆', this.currentInputGold);
        },
        finalDealFunc() {


            if (!this.telephone) {
                return this.$message.warning('请输入手机号');
            }



            if (!this.sureUseSelectPhone) {
                return this.$message.warning('请先查找用户再确认  ');
            }


            // this.resetDynamicData();
            // return;
            // if(!this.eatMethodsType){
            //   return this.$message.warning('请选择就餐方式');
            // }
            if (this.eatMethodsType == 3 && !this.storeDeskId) {
                return this.$message.warning('请选择桌号');
            }



            // if(this.couponType==undefined){
            //   return this.$message.warning('请选择优惠券');
            // }
            // if(this.cardType==undefined){
            //   return this.$message.warning('请选择会员折扣');
            // }

            if (this.payMethods == undefined) {
                return this.$message.warning('请选择支付方式');
            }

            if (this.payMethods == 5 && !this.cusPayMethods) {
                return this.$message.warning('请输入具体方式');
            }

            if (this.payMethods == 6 && !this.authCode) {
                return this.$message.warning('请用扫码枪扫微信付款码');
            }
            if (this.payMethods == 7 && !this.authCode) {
                return this.$message.warning('请用扫码枪扫支付宝付款码');
            }


            this.submitOrderFunc();

        },
        scrollInit() {
            // 获取要绑定事件的元素
            const tab_nav = document.getElementById("tab_nav")
            var flag; // 鼠标按下
            var downX; // 鼠标点击的x下标
            var scrollLeft; // 当前元素滚动条的偏移量
            tab_nav.addEventListener("mousedown", function(event) {
                flag = true;
                downX = event.clientX; // 获取到点击的x下标
                scrollLeft = this.scrollLeft; // 获取当前元素滚动条的偏移量
            });
            tab_nav.addEventListener("mousemove", function(event) {
                if (flag) { // 判断是否是鼠标按下滚动元素区域
                    var moveX = event.clientX; // 获取移动的x轴
                    var scrollX = moveX - downX; // 当前移动的x轴下标减去刚点击下去的x轴下标得到鼠标滑动距离
                    this.scrollLeft = scrollLeft - scrollX // 鼠标按下的滚动条偏移量减去当前鼠标的滑动距离
                    console.log(scrollX)
                }
            });
            // 鼠标抬起停止拖动
            tab_nav.addEventListener("mouseup", function() {
                flag = false;
            });
            // 鼠标离开元素停止拖动
            tab_nav.addEventListener("mouseleave", function(event) {
                flag = false;
            });
        },
        cateClick(index) {
            this.currentIndex = index;
        },
        deleteOftenUseFunc(idx) {
            // var json = JSON.parse(this.cbStoreInfo);
            // if (!json) {
            //     this.$router.replace("/login");
            //     return;
            // }
         
            var jsonParams = {
                userId: this.cbUserId,
                token: this.cbToken,
                bindId: idx,
             };
            //  console.log('aa-dsd---',jsonParams);

            this.$http
          .post(
            this.globalRequestUrl.deleteStoreBindPhoneAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            if (res.data.status == 200) {
              console.log("deleteStoreBindPhoneAPI---", res);
              this.$message.success('删除成功');
                this.getOftenListFunc();

          
            } else {
              this.$message.error(res.data.msg);
            }
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });

        },
        selectVoucherFunc(index, item) {
            console.log('哈哈哈', item);

            if (this.currentVipIndex != -1) {

                var text = '优惠券和金豆以及会员折扣只能使用一个';
                this.$message.warning(text);

                return;
            }
            if (this.carl_total_price < item.exceedMoney) {

                var text = '满' + item.exceedMoney + '可用';
                this.$message.warning(text);

                return;
            }
            this.couponType = item.udcId;
            this.currentVoucherIndex = index == this.currentVoucherIndex ? -1 : index;

            this.currentCardRate = 1; // 置为1，保证折扣只有一个有值
            this.inputGoldCountChange = ''; // 置为0，保证折扣只有一个有值
            for (var i = 0; i < this.couponList.length; i++) {
                var json = this.couponList[i];

                if (json.udcId == parseInt(item.udcId)) {

                    this.currentDiscountMoney = item.discountsMoney;
                }
            }
            if (this.currentVoucherIndex == -1) {
                this.currentDiscountMoney = 0;

            }




        },


        selectBuyCardFunc(index, item) {
            this.currentBuyCardIndex = index == this.currentBuyCardIndex ? -1 : index;
            this.currentBuyCardPayId = item.id;
            // this.payMethods = item.id;

            if (this.currentBuyCardPayId == 1) {
                console.log('购买会员卡---选择了用户付款码');
                this.$nextTick(() => {
                    this.$refs.authCodeNameBuyCard.focus();
                })
            }


        },
        selectPayMethodsFunc(index, item) {
            this.currenPayMethodsIndex = index == this.currenPayMethodsIndex ? -1 : index;
            this.payMethods = item.id;
            this.payMethodsText = item.payTypeName;
            if (item.id == 6) {
                console.log('选择了微信付款码');
                this.$nextTick(() => {
                    this.$refs.authCodeName.focus();
                })
            }else if (item.id == 7) {
                console.log('选择了支付宝付款码');
                this.$nextTick(() => {
                    this.$refs.authCodeName.focus();
                })
            }


        },


        selectVipFunc(index, item) {

            if (this.currentVoucherIndex != -1) {

                var text = '优惠券和金豆以及会员折扣只能使用一个';
                this.$message.warning(text);

                return;
            }
            console.log('oitem=-==', item);
            this.inputGoldCountChange = ''; // 置为0，保证折扣只有一个有值
            this.currentDiscountMoney = 0; // 置为0，保证折扣只有一个有值

            this.currentVipIndex = index == this.currentVipIndex ? -1 : index;
            this.currentCardRate = this.currentVipIndex == -1 ? 1 : item.name;


        },
        cardSelectListFunc(index, item) {
            this.currentCardSelectIndex = index == this.currentCardSelectIndex ? -1 : index;
            // this.eatMethodsType = item.id;
            console.log('currentCardSelectIndex---', this.currentCardSelectIndex, );
            if (this.currentCardSelectIndex == 0) { // 购买
                this.requestFunc();
                this.buyShow = true;
            }

            // this.telephone = mobile;
            // this.checkFunc(true);
        },
        
        selectEatMethodsFunc(index, item) {
            if (!this.sureUseSelectPhone) {
                return this.$message.warning('请先选择用户');
            }
            this.currentEatMethodsIndex = index == this.currentEatMethodsIndex ? -1 : index;
            this.eatMethodsType = this.currentEatMethodsIndex==-1?'':item.id;
            console.log('currentEatMethodsIndex---', this.currentEatMethodsIndex, '----eatMethodsType--', this.eatMethodsType);

            // this.telephone = mobile;
            // this.checkFunc(true);
        },
        selectTableNumFunc(index, item) {
            if (!this.sureUseSelectPhone) {
                return this.$message.warning('请先选择用户');
            }
            this.currentTableNumIndex = index == this.currentTableNumIndex ? -1 : index;
            this.storeDeskId = this.currentTableNumIndex==-1?'':item.id;
            console.log('currentTableNumIndex---', this.currentTableNumIndex, '---桌号--', this.storeDeskId);

            // this.telephone = mobile;
            // this.checkFunc(true);
        },

        selectOneOftenFunc(index, mobile) {
            this.clearClick();
            this.currentOftenUseIndex = index;
            this.telephone = mobile;
            this.checkFunc(true);
        },
        getOftenListFunc() {


            // var json = JSON.parse(this.cbStoreInfo);
            // if (!json) {
            //     this.$router.replace("/login");
            //     return;
            // }
      

                
            
            var jsonParams = {
                userId: this.cbUserId,
                token: this.cbToken,
                storeId: this.cbStoreId,
                                pageNum: 1,
                pageSize: 1000,
             };

            //  console.log('aa-dsd---',jsonParams);

            this.$http
          .post(
            this.globalRequestUrl.getStoreBindPhoneListAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            if (res.data.status == 200) {
            //   console.log("getStoreBindPhoneListAPI---", res);
              this.getOftenList = res.data.data;

          
            } else {
              this.$message.error(res.data.msg);
            }
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });


        },
        addOftenUseFunc(idx) {

       
            // var json = JSON.parse(this.cbStoreInfo);
            // if (!json) {
            //     this.$router.replace("/login");
            //     return;
            // }



              
            var jsonParams = {
                userId: this.cbUserId,
                token: this.cbToken,
                storeId: this.cbStoreId,
                bindUserId: idx,
             };

            //  console.log('aa-dsd---',jsonParams);

            this.$http
          .post(
            this.globalRequestUrl.addStoreBindPhoneAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            if (res.data.status == 200) {
                            this.$message.success('已设为常用');
                this.getOftenListFunc();
          
            } else {
              this.$message.error(res.data.msg);
            }
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });

        },
        resetDynamicData() {

            console.log('resetDynamicData---');
            this.authCode = '';
            this.currentIndex = 0;
            this.authCodeChange = '';
            this.sureUseSelectPhone = false;
            this.currentTableNumIndex = -1;
            this.currenPayMethodsIndex = -1;
            this.currentEatMethodsIndex = 0;
            this.currentOftenUseIndex = -1;
            this.currentCardRate = 1;
            this.currentDiscountMoney = 0.00;
            this.currentLevel1 = '';
            this.currentLevel2 = '';
            this.tempMealList = [];
            this.tempCurrentAttributeList = [];
            this.currentAttributeList = [];
            this.addGuideShow = false;
            this.storeDeskId = undefined;
            this.addShow = false;
            this.cardPayStatus = 0; // 1用户支付了会员卡  0用户未支付会员卡车
            this.cardVipJson = {};
            this.currentUserInfo = {};
            this.currentUserSelect = false;
            this.couponList = [];
            this.cardTypeList = [];
            this.couponType = undefined;
            this.cardType = undefined;
            this.payMethods = undefined;
            this.payMethodsText = '';
            this.cusPayMethods = '';
            this.telephone = '';
            this.eatMethodsType = 3;
            this.car_total_count = 0;
            this.carl_total_price = 0.00;
          
            this.getmealListFunc();



        },
        click_oneId(index1, index2, currentItem) { // 当前属性行
            console.log('----', currentItem.id);
            this.currentSkuId = currentItem.attrId;
            this.currentSkuPrice = currentItem.price;
            console.log('-currentSkuId---', this.currentSkuId);
            var tempList = [...this.tempCurrentAttributeList]; // 当前商品的所有属性


            for (var i = 0; i < tempList.length; i++) {
                var twoList = tempList[i];
                for (var j = 0; j < twoList.attrValueList.length; j++) {

                    if (twoList.attrValueList[j].id == currentItem.id) {
                        if (twoList.attrValueList[j].attrId == currentItem.attrId) {
                            for (var m = 0; m < twoList.attrValueList.length; m++) { // 遍历当前属性行，将当前属性行的属性全部取消选中
                                twoList.attrValueList[m].tempSelect = false;
                            }
                            twoList.attrValueList[j].tempSelect = true; // 将当前行的某个属性

                        }

                    }
                }
            }


            this.currentAttributeList = [...tempList];

            console.log('最新---', this.currentAttributeList);


        },



        sureGuideBtn() {
            console.log('====ff', this.currentGuideWeight);
            console.log('fgg---', this.currentAttributeList);
            // 数量重量判空弹框
            if (this.currentAttributeList) {
                if (this.currentAttributeList.length) {
                    if (parseInt(this.mealList[this.currentLevel1].itemList[this.currentLevel2].unitFlag) != 2) { // 数量
                        // if(this.currentAttributeList.length&&!this.currentGuideCount){
                        //     return this.$message.warning('请选择数量');
                        // }
                        if (!this.currentGuideCount) {
                            return this.$message.warning('请选择数量');
                        }
                    } else { // 重量
                        if (this.currentAttributeList.length) { // 规格
                            console.log('ceceecececeec');
                            if (!this.currentGuideWeight) {
                                return this.$message.warning('请输入重量');
                            }
                        } else {
                            console.log('hghghhgh');
                            if (!this.mealList[this.currentLevel1].itemList[this.currentLevel2].tempWeight) {
                                return this.$message.warning('请输入重量');
                            }
                        }

                    }
                }
            }

            // 规格判空弹框
            if (this.currentAttributeList.length) { //有规格逻辑
                console.log('临时--增加菜--规格类');
                // 必须先添加完规格才可以添加数量，否则构造数据很麻烦
                var dishFlavorStr = '';
                for (var i = 0; i < this.currentAttributeList.length; i++) {
                    var items = this.currentAttributeList[i];

                    for (var j = 0; j < items.attrValueList.length; j++) { // 某个属性(多个值)
                        var subItems = items.attrValueList[j];
                        if (subItems.tempSelect) {
                            dishFlavorStr = dishFlavorStr + subItems.attrValue + '&';
                        }
                    }

                }
                if (dishFlavorStr) {
                    dishFlavorStr = dishFlavorStr.substring(0, dishFlavorStr.length - 1);
                }
                console.log('dishFlavorStr---', dishFlavorStr);
                var dishList = dishFlavorStr ? dishFlavorStr.split('&') : [];
                console.log('ggggggggdishList---', dishList, 'his.currentAttributeList.length', this.currentAttributeList.length);
                if (dishList.length != this.currentAttributeList.length) {
                    return this.$message.warning('请先补全规格');

                }


            }


            // 走到这里就确定了某个规格
            // 然后就讲规格个数添加到某个属性中
            this.guideDealFunc();

            if (this.currentAttributeList.length) { //有规格逻辑
                console.log('you的------');
                this.mealList[this.currentLevel1].itemList[this.currentLevel2].realDifferentGuideList = [...this.mealList[this.currentLevel1].itemList[this.currentLevel2].differentGuideList];
            }


            console.log('aaa确定之后-0--', this.mealList);

            this.addMealFunc(this.currentLevel1, this.currentLevel2);


            this.clearTempSelectFunc();



        },
        guideDealFunc() {
            // 遍历某个商品的商品的所有属性集合，再遍历某个属性的所有值，如果本次选中的之前存储过，那么数量+1，否则是新的商品商品集合

            this.mealList[this.currentLevel1].itemList[this.currentLevel2].dishAttrList = [...this.currentAttributeList];


            console.log('拼接规格--', this.mealList[this.currentLevel1].itemList[this.currentLevel2]);
            var dishFlavorStr = '';
            for (var i = 0; i < this.mealList[this.currentLevel1].itemList[this.currentLevel2].dishAttrList.length; i++) { // 某个商品的所有属性集合
                var items = this.mealList[this.currentLevel1].itemList[this.currentLevel2].dishAttrList[i];

                for (var j = 0; j < items.attrValueList.length; j++) { // 某个属性(多个值)
                    var subItems = items.attrValueList[j];
                    if (subItems.tempSelect) {
                        subItems.select = subItems.tempSelect;
                        dishFlavorStr = dishFlavorStr + subItems.attrValue + '&';
                    }
                }

            }
            if (dishFlavorStr) {
                dishFlavorStr = dishFlavorStr.substring(0, dishFlavorStr.length - 1);
            }


            if (this.currentAttributeList) {
                if (this.currentAttributeList.length) {
                    if (!this.mealList[this.currentLevel1].itemList[this.currentLevel2].differentGuideList) { // 没有存储过规格
                        console.log('c没有存储过规格');
                        // if (!this.mealList[this.currentLevel1].itemList[this.currentLevel2].differentGuideList.length) { // 没有存储过规格

                        var json = { skuPrice: this.currentSkuPrice, skuId: this.currentSkuId, guideName: dishFlavorStr, guideCount: this.currentGuideCount ? this.currentGuideCount : this.currentGuideWeight, unitFlag: this.currentGuideCount ? 1 : 2 }; // 规格数量由输入框控制
                        this.mealList[this.currentLevel1].itemList[this.currentLevel2].differentGuideList = [];
                        this.mealList[this.currentLevel1].itemList[this.currentLevel2].differentGuideList.push(json);
                        // }
                        // this.guideInputCount = 1;
                    } else { // 之前存储过规格
                        var tempAlldifferentGuideList = [...this.mealList[this.currentLevel1].itemList[this.currentLevel2].differentGuideList];
                        console.log('之前存储过规格');
                        var hasFind = false;
                        for (var i = 0; i < tempAlldifferentGuideList.length; i++) { // 遍历所有存储过的规格列表
                            var item = tempAlldifferentGuideList[i];
                            if (dishFlavorStr == item.guideName) { // 之前存储过相同规格的

                                item.guideCount = this.currentGuideCount ? this.currentGuideCount : this.currentGuideWeight;
                                console.log('之前存储过相同规格的', dishFlavorStr, '---currentGuideCount--', this.currentGuideCount, '---本次个数', item.guideCount, 'currentGuideWeight', this.currentGuideWeight);
                                hasFind = true;
                                return;
                                // this.guideInputCount = this.guideInputCount;
                            } else { // 之前没有存储过相同规格的


                            }
                        }
                        if (hasFind == false) { // 之前没有存储过相同规格的
                            console.log('之前没有存储过相同规格的', dishFlavorStr, '====本次数量', this.currentGuideCount, '====本次重量', this.currentGuideWeight);
                            var json = { skuPrice: this.currentSkuPrice, skuId: this.currentSkuId, guideName: dishFlavorStr, guideCount: this.currentGuideCount ? this.currentGuideCount : this.currentGuideWeight, unitFlag: this.currentGuideCount ? 1 : 2 }; // 规格数量由输入框控制
                            console.log('当前要存储的json', json);
                            this.mealList[this.currentLevel1].itemList[this.currentLevel2].differentGuideList.push(json);
                        }

                    }
                }
            }
            console.log('临时规格内容', this.mealList);

        },
        addMealFunc(level1, level2) {

// if(this.eatMethodsType==undefined){
//   return   this.$message.warning('请选择堂食还是外带');
// }
console.log('ffffgggh确认--增加菜', level1, '---', level2);
// this.car_total_count = this.temp_car_total_count;
console.log('tempCount处理前---', this.mealList[level1].itemList[level2].tempCount);
console.log('tempWeight处理前---', this.mealList[level1].itemList[level2].tempWeight);
if (!this.currentAttributeList.length) { // 非规格
    console.log('非规格');
    if (parseInt(this.mealList[level1].itemList[level2].unitFlag) != 2) { // 数量
        // 没有临时输入的值或者临时值为1
        if (!this.mealList[level1].itemList[level2].tempCount || this.mealList[level1].itemList[level2].tempCount == 1) {

            this.mealList[level1].itemList[level2].count = 1;

        } else {
            this.mealList[level1].itemList[level2].count = this.mealList[level1].itemList[level2].tempCount;

        }
    } else if (parseInt(this.mealList[level1].itemList[level2].unitFlag) == 2) { // 重量
        // 
        this.mealList[level1].itemList[level2].customWeight = this.mealList[level1].itemList[level2].tempWeight;
        console.log('iiyu是重量', this.mealList[level1].itemList[level2].customWeight);
        this.mealList[level1].itemList[level2].count = 1;
    }
}

this.mealList = [...this.mealList];
console.log('=dd===', this.mealList);

// return;


// 计算规格与非规格的总价
this.calGuideTotalPriceFunc(level1, level2);



var carTotalCount = 0;
for (var i = 0; i < this.mealList.length; i++) { // 先计算购物车中非规格商品的个数
    var item1 = this.mealList[i];
    for (var j = 0; j < item1.itemList.length; j++) {
        var item2 = item1.itemList[j];
        // if(item2.realDifferentGuideList){

        // }else{
        // if (!item2.realDifferentGuideList || item2.realDifferentGuideList == undefined) {
        // if (!item2.realDifferentGuideList.length) {
        console.log('---vv--bb-', item2.realDifferentGuideList);
        console.log('---item2.count', item2.count);
        // if (item2.realDifferentGuideList.length==0) {
        var count2 = item2.count ? item2.count : 0;
        carTotalCount = carTotalCount + count2;
        // }
        // }
        // }
    }
}
for (var i = 0; i < this.mealList.length; i++) { // 计算购物车中的规格商品的个数
    var item1 = this.mealList[i];
    for (var j = 0; j < item1.itemList.length; j++) {
        var item2 = item1.itemList[j];
        if (item1.itemList[j].realDifferentGuideList) { // 规格
            for (var k = 0; k < item2.realDifferentGuideList.length; k++) {
                if (parseInt(item2.unitFlag) != 2) {
                    carTotalCount = carTotalCount + item2.realDifferentGuideList[k].guideCount;
                } else { // 无论多少千克按1个
                    carTotalCount = carTotalCount + 1;
                }

            }
            // carTotalCount = carTotalCount + item1.itemList[j].realDifferentGuideList.length;
        }



    }
}


console.log('---carTotalCount---', carTotalCount);
this.car_total_count = carTotalCount;


console.log('tempCount处理后---', this.mealList[level1].itemList[level2].tempCount);
console.log('tempWeight处理后---', this.mealList[level1].itemList[level2].tempWeight);
console.log('增加菜后', this.mealList);
console.log('值为--', this.mealList[level1].itemList[level2].count);

// this.abcd = this.mealList[level1].itemList[level2].count + '' + new Date().valueOf();// 数据变更，保证数据刷新

},
        clearTempSelectFunc() {
            console.log('clearTempSelectFunc---');
            // this.mealList[this.currentLevel1].itemList[this.currentLevel2].dishAttrList = [...this.tempCurrentAttributeList];
            // this.mealList[this.currentLevel1].itemList[this.currentLevel2].dishAttrList = [];
            // this.tempCurrentAttributeList = [...this.currentAttributeList];
            console.log(this.currentLevel1, '--', this.currentLevel2, 'shujuyua--', this.mealList);
            console.log('清空之前的aaa', this.currentAttributeList, '~~~~', this.tempCurrentAttributeList);

            if (this.mealList[this.currentLevel1].itemList[this.currentLevel2].dishAttrList) {
                for (var i = 0; i < this.mealList[this.currentLevel1].itemList[this.currentLevel2].dishAttrList.length; i++) { // 某个商品的所有属性集合
                    var items = this.mealList[this.currentLevel1].itemList[this.currentLevel2].dishAttrList[i];

                    for (var j = 0; j < items.attrValueList.length; j++) { // 某个属性(多个值)
                        var subItems = items.attrValueList[j];
                        subItems.tempSelect = false;
                    }

                }
            }
            this.addGuideShow = false;


        },



        closeGuideBtnClick() {
            console.log('closeGuideBtnClick---');
            this.submitShow = false;
            this.addGuideShow = false;
            this.clearTempSelectFunc();
        },
        hideGuide() {
            console.log('hideGuide---');
            this.addGuideShow = false;
            this.clearTempSelectFunc();
        },

        hide() {
            this.closeBtnClick();
        },
        tableNumClick(value) {
            console.log(value.target.value);
            this.storeDeskId = value.target.value;
        },
        closeBtnClick() {
            this.orderShow = false;
            this.addShow = false;
            this.sureUseSelectPhone = false;
            this.telephone = '';
            this.currentOftenUseIndex = -1;
        },
        sureUserBtn() {
            this.sureUseSelectPhone = true;

            this.addShow = false;
            // this.resetDynamicData();
        },

        useVipDiscountClick(value) {
            this.useVipDiscount = value.target.value;
            console.log('是否用折扣---', this.useVipDiscount);
        },
        couponTypeClick(value) {
            console.log(value.target.value);
            this.couponType = value.target.value;
            if (parseInt(value.target.value) == -1) { // 不使用优惠券

            } else { // 使用优惠券



                // console.log('---couponList',this.couponList);


                for (var i = 0; i < this.couponList.length; i++) {
                    var item = this.couponList[i];

                    if (item.udcId == parseInt(this.couponType)) {

                        this.currentDiscountMoney = item.discountsMoney;
                    }
                }
            }
            this.couponType = value.target.value;

        },
   
        submitClick() {

            if (!this.sureUseSelectPhone) {
                return this.$message.warning('请先选择用户');
            }
              if(!this.eatMethodsType){
              return this.$message.warning('请选择就餐方式');
            }
            if (this.eatMethodsType == 3 && !this.storeDeskId) {
                return this.$message.warning('请选择桌号');
            }
            if (!this.car_total_count) {
                return this.$message.warning('请选择菜品');
            }
          



            if (this.hasGoldCount < (this.carl_total_price - this.allTotalNoJoinVipPrice) * this.fyproBenefitItemRate * 100) { // 自己拥有的金豆 小于 本单可用的金豆，就取 自己拥有的金豆作为最大值
                this.inputGoldMax = this.hasGoldCount;
            } else { // 自己拥有的金豆 大于等于 本单可用的金豆，就取 本单可用的金豆作为最大值

                this.inputGoldMax = parseInt((this.carl_total_price - this.allTotalNoJoinVipPrice) * this.fyproBenefitItemRate * 100);
            }



            console.log('最大输入金豆=---', this.inputGoldMax, '===类型---', typeof(this.inputGoldMax));
            this.submitShow = true;


        },


        checkFunc(tempSureUseSelectPhone) {
         
            this.sureUseSelectPhone = tempSureUseSelectPhone;
            // var json = JSON.parse(this.cbStoreInfo);
            // if (!json) {
            //     this.$router.replace("/login");
            //     return;
            // }
       


            
            
            var jsonParams = {
                userId: this.cbUserId,
                token: this.cbToken,
                storeId: this.cbStoreId,
                telephone: this.telephone,
             };
            //  console.log('aa-dsd---',jsonParams);

            this.$http
          .post(
            this.globalRequestUrl.checkUserAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            if (res.data.status == 200) {
              console.log("checkUserAPI---", res);
              if (tempSureUseSelectPhone == false) { // 常用号码，不弹框
                    this.addShow = true;
                }
                this.currentUserSelect = true;
                this.currentUserInfo = res.data.data;
                this.getUserAssetsGoldFunc();
                this.getMyCouponForStoreByTypeFunc();

                this.checkIsBuyStoreAnnualCardFunc();
                this.getStoreAndBranchInfoFunc();

          
            } else {
                this.cardPayStatus = 0;

              this.$message.error(res.data.msg);
            }
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });



        },

        getStoreAndBranchInfoFunc() {


            // var json = JSON.parse(this.cbStoreInfo);
            // if (!json) {
            //     this.$router.replace("/login");
            //     return;
            // }
   


            
            
            var jsonParams = {
                userId: this.cbUserId,
                token: this.cbToken,
                storeId: this.cbStoreId,
                employeeId: '',
                buyUserId: this.currentUserInfo.user.id,
             };
            //  console.log('aa-dsd---',jsonParams);

            this.$http
          .post(
            this.globalRequestUrl.getStoreAndBranchInfoAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            if (res.data.status == 200) {
              console.log("getStoreAndBranchInfoAPI---", res);
              this.fyproBenefitItemRate = res.data.data.fyproBenefitItemRate;

          
            } else {
              this.$message.error(res.data.msg);
            }
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });




        },
        getUserAssetsGoldFunc() {



  
            
            var jsonParams = {
                userId: this.cbUserId,
                token: this.cbToken,
                buyUserId: this.currentUserInfo.user.id,
             };
            //  console.log('aa-dsd---',jsonParams);

            this.$http
          .post(
            this.globalRequestUrl.getUserAssetsGoldAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            if (res.data.status == 200) {
              console.log("getUserAssetsGoldAPI---", res);


              this.hasGoldCount = res.data.data.totalMoney;
            } else {
              this.$message.error(res.data.msg);
            }
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });

        },
        checkIsBuyStoreAnnualCardFunc() {


            // var json = JSON.parse(this.cbStoreInfo);
            // if (!json) {
            //     this.$router.replace("/login");
            //     return;
            // }

            
            var jsonParams = {
                userId: this.cbUserId,
                token: this.cbToken,
                storeId: this.cbStoreId,
                buyUserId: this.currentUserInfo.user.id,
             };
            //  console.log('aa-dsd---',jsonParams);

            this.$http
          .post(
            this.globalRequestUrl.checkIsBuyStoreAnnualCardAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            console.log("检查用户是否购买了此店铺会员卡=====", res.data);
            if (res.data.status == 200) {
              console.log("checkIsBuyStoreAnnualCardAPI---", res);
              if (res.data.data) {

                this.showBuyBtn = false;
                this.getCardListFunc(res.data.data);
                this.getAllCardItemListForOneStoreAppletsFunc();
                } else {
                this.currentCardSelectIndex = 1;
                this.showBuyBtn = true;
                console.log('清除----');
                if (this.mealList[this.mealList.length - 1].id == 9999) {
                    this.mealList.splice(this.mealList.length - 1, 1);
                }
                }

          
            } else {
                console.log('aaa清除----');
                    this.currentCardSelectIndex = 1;
                    this.showBuyBtn = true;
                    if (this.mealList[this.mealList.length - 1].id == 9999) {
                        this.mealList.splice(this.mealList.length - 1, 1);
                    }
            }
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });




        },
        getCardListFunc(cardId) {
            // var json = JSON.parse(this.cbStoreInfo);
            // if (!json) {
            //     this.$router.replace("/login");
            //     return;
            // }

            
            var jsonParams = {
                userId: this.cbUserId,
                token: this.cbToken,
                storeId: this.cbStoreId,
                cardId: cardId,
             };
            //  console.log('aa-dsd---',jsonParams);

            this.$http
          .post(
            this.globalRequestUrl.getCardListAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            if (res.data.status == 200) {
              console.log("getCardListAPI---", res);
              this.cardVipJson = res.data.data[0];
                this.useVipDiscountList = [];
                this.useVipDiscountList.push({ name: res.data.data[0].payRate, id: res.data.data[0].id });

          
            } else {
              this.$message.error(res.data.msg);
            }
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });



        },
        getAllCardItemListForOneStoreAppletsFunc() {
            // var json = JSON.parse(this.cbStoreInfo);
            // if (!json) {
            //     this.$router.replace("/login");
            //     return;
            // }
          
            var jsonParams = {
                userId: this.cbUserId,
                token: this.cbToken,
                storeId: this.cbStoreId,
                buyUserId: this.currentUserInfo.user.id,
             };
            //  console.log('aa-dsd---',jsonParams);

            this.$http
          .post(
            this.globalRequestUrl.getAllCardItemListForOneStoreAppletsAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            if (res.data.status == 200) {
              console.log("getAllCardItemListForOneStoreAppletsAPI---", res);
              this.hasProfitData = true;
                // this.mealList.push({itemList: [], name: "会员权益", id: 9999});

                // console.log('嘻哈---', this.mealList);

                if (this.mealList[this.mealList.length - 1].id == 9999) {
                    this.mealList.splice(this.mealList.length - 1, 1);
                }
                var tempList = [];
                for (var i = 0; i < res.data.data.length; i++) {
                    var item = res.data.data[i];
                    var json = {};
                    json.storeCid = 9999;
                    json.id = item.productId;
                    json.image = item.productImage;
                    // json.price = item.originalPrice;
                    json.price = item.productPrice;
                    json.realPrice = item.price;
                    json.title = item.productName;
                    json.unitFlag = 1;
                    json.surplusUse = item.surplusUse;
                    json.surplusUseFixed = item.surplusUse;
                    json.dishAttrList = item.dishAttrList;
                    json.skuList = item.skuList;
                    json.differentGuideList = [];
                    json.realDifferentGuideList = [];
                    json.num = item.surplusUse;
                    tempList.push(json);
                }
                this.mealList.push({ itemList: tempList, name: "会员权益", id: 9999 });

                for (var i = 0; i < this.mealList.length; i++) {
                    var item1 = this.mealList[i];
                    for (var m = 0; m < item1.itemList.length; m++) {
                        var item2 = item1.itemList[m];
                        item2.dishAttrList = [];
                        var json1 = {};
                        var oneList = [];
                        if (item2.skuList == null) {
                            item2.skuList = [];
                        }
                        for (var j = 0; j < item2.skuList.length; j++) {
                            var item3 = item2.skuList[j];
                            var json2 = {};
                            json2.createTime = item3.createTime;
                            json2.attrId = item3.id;
                            json2.image = item3.image;
                            json2.itemId = item3.itemId;
                            json2.id = item3.itemId;
                            json2.num = item3.num;
                            json2.price = item3.price;
                            json2.status = item3.status;
                            json2.attrValue = item3.title;
                            json2.weight = item3.weight;
                            json2.unitFlag = parseInt(item2.unitFlag);
                            oneList.push(json2);

                        }
                        json1.attrName = oneList.length ? '规格(' + oneList.length + ')' : '';
                        json1.attrValueList = oneList;
                        json1.id = '';
                        json1.itemId = item2.id;
                        // console.log('--json1.attrValueList.length-', json1.attrValueList.length);
                        if (json1.attrValueList.length) {
                            item2.dishAttrList.push(json1);
                        }

                    }
                }
                console.log('ffffg最新----', this.mealList);

          
            } else {
              this.$message.error(res.data.msg);
            }
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });




        },
        getMyCouponForStoreByTypeFunc() {
            // var json = JSON.parse(this.cbStoreInfo);
            // if (!json) {
            //     this.$router.replace("/login");
            //     return;
            // }
            var jsonParams = {
                storeId: this.cbStoreId,
                couponType: 1,
                userId: this.currentUserInfo.user.id,
                token: this.currentUserInfo.token,
            };



            let instance = axios.create({});
            instance({
                    method: "post",
                    url: `https://api.feiyanghy.life/discountCoupon/getMyCouponForStoreByType`,
                    data: qs.stringify(jsonParams),
                    headers: {
                        "Content-Type": "application/x-www-form-urlencoded",
                    },
                    timeout: 120000, // 37秒超时时间
                })
                .then((response) => {
                    // setTimeout(this.toastHide, 0);
                    // console.log('ddddddddddd');
                    // this.cardPayStatus = response.data.status;
                    this.couponList = response.data.data;
                    // if(this.couponList.length){
                    //     var json = {name:'不使用',udcId:0,exceedMoney:0,discountsMoney:0};
                    //     this.couponList.push(json);
                    // }
                    console.log("法对对对结果", JSON.stringify(response));


                })
                // 解决网络异常，不写如下catch，会在控制台打印报错信息的问题
                .catch((error) => {
                    // setTimeout(this.toastHide, 0);
                    // this.frequentlyToastShow = false;
                    console.log("异常了eeeeeeeeeeee", error);
                });



        },


        submitOrderFunc() {
           

            var dealItems = [];
            // 如果点击+请求数据的话
            // 如果点击+不请求数据的话，两个人同时操作+，最后点击加入购物车的话，再次打开这个商品的话，如果显示1的话，就没法删除了。所以
            for (var i = 0; i < this.mealList.length; i++) { // 计算总价
                var item1 = this.mealList[i];
                for (var j = 0; j < item1.itemList.length; j++) {
                    var dishFlavorStr = '';
                    var item2 = item1.itemList[j];
                    if (item2.count) {
                        if (item2.dishAttrList) {
                            for (var m = 0; m < item2.dishAttrList.length; m++) {
                                var dishItem = item2.dishAttrList[m];
                                if (dishItem.attrValueList) {
                                    for (var n = 0; n < dishItem.attrValueList.length; n++) {
                                        var dishValueItem = dishItem.attrValueList[n];
                                        console.log('ddd--', dishValueItem);
                                        if (dishValueItem.select) {
                                            dishFlavorStr = dishFlavorStr + dishValueItem.attrValue + '/';
                                        }
                                    }
                                }


                            }
                        }
                        if (dishFlavorStr) {
                            dishFlavorStr = dishFlavorStr.substring(0, dishFlavorStr.length - 1);
                        }
                        var json = {};
                        if (parseInt(item2.unitFlag) != 2) { // 数量
                            json = {
                                dishFlavor: dishFlavorStr,
                                itemId: item2.id,
                                num: item2.count,
                                weight: 0,
                                picPath: item2.image,
                                price: item2.price,
                                title: item2.title,
                                totalFee: item2.price * item2.count,
                                unitFlag: 1,
                            };
                        } else { // 重量
                            json = {
                                dishFlavor: dishFlavorStr,
                                itemId: item2.id,
                                num: '',
                                weight: item2.customWeight,
                                picPath: item2.image,
                                price: item2.price,
                                title: item2.title,
                                totalFee: item2.price * item2.count,
                                unitFlag: 2,
                            };
                        }
                        dealItems.push(json);
                        // dealItems.push({
                        //     dishFlavor: dishFlavorStr,
                        //     itemId: item2.id,
                        //     num: item2.count,
                        //     picPath: item2.image,
                        //     price: item2.price,
                        //     title: item2.title,
                        //     totalFee: item2.price * item2.count,
                        // });
                    }

                    if (item2.realDifferentGuideList) {
                        if (item2.realDifferentGuideList.length) {
                            for (var m = 0; m < item2.realDifferentGuideList.length; m++) {
                                var item3 = item2.realDifferentGuideList[m];

                                var json = {};
                                if (parseInt(item2.unitFlag) != 2) { // 数量
                                    json = {
                                        dishFlavor: item3.guideName,
                                        itemId: item2.id,
                                        num: item3.guideCount,
                                        weight: 0,
                                        picPath: item2.image,
                                        price: item2.price,
                                        title: item2.title,
                                        totalFee: item2.price * item3.guideCount,
                                        unitFlag: 1,
                                    };
                                } else { // 重量
                                    json = {
                                        dishFlavor: item3.guideName,
                                        itemId: item2.id,
                                        num: '',
                                        weight: item3.guideCount,
                                        picPath: item2.image,
                                        price: item2.price,
                                        title: item2.title,
                                        totalFee: item2.price * item3.guideCount,
                                        unitFlag: 2,
                                    };
                                }
                                dealItems.push(json);
                            }

                        }
                    }

                }
            }

        




            // console.log(applyinfoList);
            var dealList = [];
            var dealJson = {};

            // (this.onlyShopTotalPrice.toFixed(2) - this.currentDiscountMoney)*(1 - currentCardRate)).toFixed(2)


            // cardTypeList
            var dealOrder = {
                storeDeskId: this.storeDeskId == undefined ? '' : this.storeDeskId,
                deliveryType: this.eatMethodsType, // 收银台点餐 3堂食   4外带
                invitationCode: this.payMethodsText, // 付款方式  
                annualCardId: "",
                buyerMessage: "",
                buyerNick: '',
                // cardDiscountAmount: this.cardType?this.carl_total_price*(100 -this.cardVipJson.payRate*100)/100:'',// 26.39
                // cardDiscountAmount: ((this.onlyShopTotalPrice.toFixed(2) - this.currentDiscountMoney) * (1 - this.currentCardRate)).toFixed(2),
                cardDiscountAmount: ((1 - this.currentCardRate) * this.carl_total_price).toFixed(2),

                cityCouponNo: "",
                deliveryTime: "",
                discountCoupons: [],
                goldPrice: this.inputGoldCount ? this.inputGoldCount : '',
                isBuyAnnualCard: 0,
                orderType: 1,
                // payment: this.carl_total_price,
                payment: this.carl_total_price.toFixed(2) - this.currentDiscountMoney - this.manDiscountAmount -  this.inputGoldCount / 100 - ((1 - this.currentCardRate) * this.carl_total_price).toFixed(2),
                postFee: '',
                postType: 1,
                remark: "",
                storeId: this.cbStoreId,
                userDiscountCouponId: this.couponType,
                // userId: this.cbUserId,

                userId: this.currentUserInfo.user.id,
                manDiscountAmount:this.manDiscountAmount,


            };
            var dealShip = {
                receiverAddress: this.currentUserInfo.user.deviceId,
                receiverMobile: this.currentUserInfo.user.phone,
                receiverName: this.currentUserInfo.user.realName ? this.currentUserInfo.user.realName : this.currentUserInfo.user.username,
                receiverPhone: this.currentUserInfo.user.phone,
                receiverZip: "",
            };
            dealJson.order = dealOrder;
            dealJson.items = dealItems;
            dealJson.ship = dealShip;
            dealList.push(dealJson);
            // return
            var jsonParams = {
                // storeId: this.cbStoreId,
                // token: this.cbToken,
                // userId: this.cbUserId,
                token: this.currentUserInfo.token,
                // userId: this.currentUserInfo.user.id,
                list: dealList,
            };
            console.log("数据为", jsonParams);
            // return;
            this.frequentlyToastShow = true;
            this.toastHide = this.$message.loading("处理中....", 0);

            // PUBLISHSTOREACTIVITYAPI(jsonParams)

            let instance = axios.create({});
            instance({
                    method: "post",
                    // url: this.payMethods == 6 ? 'https://api.feiyanghy.life/order/createWxOrderForBTOC' : 'https://api.feiyanghy.life/order/createChinaumsOrderForCashier',
                    url: this.payMethods == 6 ? 'https://api.feiyanghy.life/order/createWxOrderForBTOCSupprotWeight':(this.payMethods== 7?'https://api.feiyanghy.life/order/createAliPayOrderForBTOCSupprotWeight':'https://api.feiyanghy.life/order/createChinaumsOrderForCashierSupprotWeight'),

                    data: jsonParams,
                    headers: {
                        "Content-Type": "application/json",
                        // "Content-Type": "text/plain",
                    },
                })
                .then((res) => {
                    console.log("拿到的为", res);

                    if (res.data.status !== 200) {
                        this.frequentlyToastShow = false;
                        this.$message.warning(res.data.msg);
                        setTimeout(this.toastHide, 0);
                        return;
                    }
                    if (this.payMethods == 6) {
                        this.wxBTOCPayForGoodFunc(res.data.data[0].order.id);
                    }if (this.payMethods == 7) {
                        this.aliPayBTOCForGoodsFunc(res.data.data[0].order.id);
                    } else {
                        setTimeout(this.toastHide, 0);
                        this.originalDataFunc();
                    }
                    this.submitShow = false;


                    // this.$router.go(-1);
                })
                .catch((error) => {
                    console.log("哈哈哈哈哈哈eeeeeeeeeeee", error);
                    this.frequentlyToastShow = false;
                    setTimeout(this.toastHide, 0);
                });
        },
        originalDataFunc() {
            this.authCode = '';
            this.$message.success("提交成功");
            this.resetDynamicData();
        
            this.frequentlyToastShow = false;
        },
        
        aliPayBTOCForGoodsFunc(idx) {
          
          // var json = JSON.parse(this.cbStoreInfo);
          // if (!json) {
          //     this.$router.replace("/login");
          //     return;
          // }


          this.authCode = this.authCode.replace(/\r|\n/ig, "");

          var jsonParams = {
              userId: this.cbUserId,
              token: this.cbToken,
              storeId: this.cbStoreId,
              orderId: idx,
              authCode: this.authCode,
           };
          //  console.log('aa-dsd---',jsonParams);

          this.$http
        .post(
          this.globalRequestUrl.aliPayBTOCForGoodsAPI,
          this.qs.stringify(jsonParams)
        )
        .then((res) => {
          if (res.data.status == 200) {
            console.log("wxBTOCPayForGoodsAPI---", res);
            this.originalDataFunc();

        
          } else {
            this.$message.error(res.data.msg);
          }
          setTimeout(this.toastHide, 0);
        })
        .catch(function (err) {
          // this.$message.error("服务器错误，请检查！");
        });




      },
        wxBTOCPayForGoodFunc(idx) {
          
            // var json = JSON.parse(this.cbStoreInfo);
            // if (!json) {
            //     this.$router.replace("/login");
            //     return;
            // }


            this.authCode = this.authCode.replace(/\r|\n/ig, "");

            var jsonParams = {
                userId: this.cbUserId,
                token: this.cbToken,
                storeId: this.cbStoreId,
                orderId: idx,
                authCode: this.authCode,
             };
            //  console.log('aa-dsd---',jsonParams);

            this.$http
          .post(
            this.globalRequestUrl.wxBTOCPayForGoodsAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            if (res.data.status == 200) {
              console.log("wxBTOCPayForGoodsAPI---", res);
              this.originalDataFunc();

          
            } else {
              this.$message.error(res.data.msg);
            }
            setTimeout(this.toastHide, 0);
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });




        },


        addCarGuideMealFunc(level1, level2, level3) {
            console.log('喜欢000=');
            this.mealList[level1].itemList[level2].differentGuideList[level3].guideCount = this.mealList[level1].itemList[level2].differentGuideList[level3].guideCount + 1;
            this.mealList = [...this.mealList];


            // 计算规格与非规格的总价
            this.calGuideTotalPriceFunc(level1, level2);


            var carTotalCount = 0;
            for (var i = 0; i < this.mealList.length; i++) { // 先计算购物车中非规格商品的个数
                var item1 = this.mealList[i];
                for (var j = 0; j < item1.itemList.length; j++) {
                    var item2 = item1.itemList[j];
                    // if(parseInt(this.mealList[level1].itemList[level2].unitFlag)==1){// 数量
                    var count2 = item2.count ? item2.count : 0;
                    carTotalCount = carTotalCount + count2;
                    // }else{//  重量

                    // }
                }
            }
            for (var i = 0; i < this.mealList.length; i++) { // 计算购物车中的规格商品的个数
                var item1 = this.mealList[i];
                for (var j = 0; j < item1.itemList.length; j++) {
                    var item2 = item1.itemList[j];
                    if (item1.itemList[j].realDifferentGuideList) {
                        for (var k = 0; k < item2.realDifferentGuideList.length; k++) {
                            if (parseInt(item2.unitFlag) != 2) {
                                carTotalCount = carTotalCount + item2.realDifferentGuideList[k].guideCount;
                            } else { // 无论多少千克按1个
                                carTotalCount = carTotalCount + 1;
                            }
                        }
                        // carTotalCount = carTotalCount + item1.itemList[j].realDifferentGuideList.length;
                    }

                }
            }


            console.log('---carTotalCount---', carTotalCount);
            this.car_total_count = carTotalCount;



        },

  // 计算规格与非规格的总价
  calGuideTotalPriceFunc(level1, level2) {
            var carTotalPirce = 0;
            var onlyShopTotalPrice = 0;
            var totalNoJoinVipPrice = 0;
            for (var i = 0; i < this.mealList.length; i++) { // 计算非规格的总价
                var item1 = this.mealList[i];
                for (var j = 0; j < item1.itemList.length; j++) {
                    var item2 = item1.itemList[j];
                    var count2;

                    if (!item2.realDifferentGuideList || item2.realDifferentGuideList == undefined) {
                        console.log('----item2.realDifferentGuideList', item2.realDifferentGuideList);
                        if (item2.unitFlag != 2) {

                            count2 = item2.count ? item2.count : 0;
                            console.log('是数量', count2);
                        } else { // 重量

                            count2 = item2.customWeight ? item2.customWeight : 0;
                            console.log('454545是重量', count2);
                        }

                        if (i == level1 && j == level2) { // 当前添加的
                            console.log('items2----', item2, '----eatMethodsType--', this.eatMethodsType);

                            // var dealCount = item2.count ? item2.count + 1 : 1;
                            // var dealCount = item2.count;
                            var dealCount = count2;
                            console.log('加上总包装费', item2.packingFee * dealCount);
                            if (this.eatMethodsType == 4) {
                                if (parseInt(item2.payRateFlag) == 0) { // 不参与会员折扣
                                    totalNoJoinVipPrice = item2.price * dealCount + item2.packingFee * dealCount + totalNoJoinVipPrice;
                                } else {
                                    carTotalPirce = carTotalPirce + item2.price * dealCount + item2.packingFee * dealCount;
                                }

                            } else {
                                if (parseInt(item2.payRateFlag) == 0) { // 不参与会员折扣
                                    totalNoJoinVipPrice = item2.price * dealCount + totalNoJoinVipPrice;
                                } else {
                                    carTotalPirce = carTotalPirce + item2.price * dealCount;
                                }

                            }
                            onlyShopTotalPrice = onlyShopTotalPrice + item2.price * dealCount;



                        } else {
                            console.log('fdfdfdfd----', item2);
                            if (this.eatMethodsType == 4) {
                                if (parseInt(item2.payRateFlag) == 0) { // 不参与会员折扣
                                    totalNoJoinVipPrice = item2.price * count2 + item2.packingFee * count2 + totalNoJoinVipPrice;
                                } else {
                                    carTotalPirce = carTotalPirce + item2.price * count2 + item2.packingFee * count2;
                                }

                            } else {
                                if (parseInt(item2.payRateFlag) == 0) { // 不参与会员折扣
                                    totalNoJoinVipPrice = item2.price * count2 + totalNoJoinVipPrice;
                                } else {
                                    carTotalPirce = carTotalPirce + item2.price * count2;
                                }

                            }
                            onlyShopTotalPrice = onlyShopTotalPrice + item2.price * count2;
                        }
                    }
                }
            }


            for (var i = 0; i < this.mealList.length; i++) { // 计算规格的总价
                var item1 = this.mealList[i];
                for (var j = 0; j < item1.itemList.length; j++) {
                    var item2 = item1.itemList[j];
                    var count2;
                    if (item2.realDifferentGuideList) {
                        for (var k = 0; k < item2.realDifferentGuideList.length; k++) {
                            var item3 = item2.realDifferentGuideList[k];
                            if (item2.unitFlag != 2) { // 是item2下的
                                console.log('jjj--', item3.guideCount);
                                count2 = item3.guideCount != undefined ? item3.guideCount : 0; // 取item3
                                console.log('a是数量', count2);
                            } else { // 重量

                                // count2 = item2.customWeight ? item2.customWeight : 0;
                                // count2 = this.currentGuideWeight ? this.currentGuideWeight : 0;
                                count2 = item3.guideCount != undefined ? item3.guideCount : 0; // 取item3
                                console.log('a是重量', count2);
                            }

                            if (i == level1 && j == level2) { // 当前添加的
                                console.log('aitems2----', item2);

                                var dealCount = count2;
                                console.log('a加上总包装费', item2.packingFee * dealCount);
                                if (this.eatMethodsType == 4) {
                                    if (parseInt(item2.payRateFlag) == 0) { // 不参与会员折扣
                                        totalNoJoinVipPrice = item3.skuPrice * dealCount + item2.packingFee * dealCount + totalNoJoinVipPrice;

                                    } else {
                                        carTotalPirce = carTotalPirce + item3.skuPrice * dealCount + item2.packingFee * dealCount;
                                    }

                                } else {
                                    if (parseInt(item2.payRateFlag) == 0) { // 不参与会员折扣
                                        totalNoJoinVipPrice = item3.skuPrice * dealCount + totalNoJoinVipPrice;

                                    } else {
                                        carTotalPirce = carTotalPirce + item3.skuPrice * dealCount;
                                    }

                                }


                                onlyShopTotalPrice = onlyShopTotalPrice + item3.skuPrice * dealCount;

                            } else {
                                console.log('afdfdfdfd----', item2);
                                if (this.eatMethodsType == 4) {
                                    if (parseInt(item2.payRateFlag) == 0) { // 不参与会员折扣
                                        totalNoJoinVipPrice = item3.skuPrice * count2 + item2.packingFee * count2 + totalNoJoinVipPrice;

                                    } else {
                                        carTotalPirce = carTotalPirce + item3.skuPrice * count2 + item2.packingFee * count2;
                                    }

                                } else {
                                    if (parseInt(item2.payRateFlag) == 0) { // 不参与会员折扣
                                        totalNoJoinVipPrice = item3.skuPrice * count2 + totalNoJoinVipPrice;

                                    } else {
                                        carTotalPirce = carTotalPirce + item3.skuPrice * count2;
                                    }

                                }
                                onlyShopTotalPrice = onlyShopTotalPrice + item3.skuPrice * count2;
                            }
                        }
                    }



                }
            }

            this.allTotalNoJoinVipPrice = totalNoJoinVipPrice;

            this.carl_total_price = carTotalPirce + totalNoJoinVipPrice;

            console.log('allTotalNoJoinVipPrice----', this.allTotalNoJoinVipPrice);


            this.onlyShopTotalPrice = onlyShopTotalPrice;
            this.mealList = [...this.mealList];

        },


        addCarMealFunc(level1, level2) {

// if(this.eatMethodsType==undefined){
//   return   this.$message.warning('请选择堂食还是外带');
// }
console.log('1111aaas增加菜');

this.car_total_count = this.car_total_count + 1;


console.log('处理前---', this.mealList[level1].itemList[level2].tempCount);

// 注意：保证count和tempCount的一致性
if (!this.mealList[level1].itemList[level2].count) {

    this.mealList[level1].itemList[level2].count = 1;
    this.mealList[level1].itemList[level2].tempCount = 1;

} else {
    this.mealList[level1].itemList[level2].count = this.mealList[level1].itemList[level2].count + 1;
    this.mealList[level1].itemList[level2].tempCount = this.mealList[level1].itemList[level2].count;

}

this.mealList = [...this.mealList];
console.log('总个数---', this.car_total_count);

console.log('增加菜后', this.mealList);
console.log('值为--', this.mealList[level1].itemList[level2].count);

this.calGuideTotalPriceFunc(level1, level2);

},

     
minusCarGuideMealFunc(level1, level2, level3) {
            console.log('1111guide----jianshao--level1', level1, '----level2---', level2);

            if (this.mealList[level1].itemList[level2].differentGuideList[level3].guideCount == 1) {
                return this.deleteGuideCarItem(level1, level2, level3);



            } else {
                this.mealList[level1].itemList[level2].differentGuideList[level3].guideCount = this.mealList[level1].itemList[level2].differentGuideList[level3].guideCount - 1;
                this.mealList = [...this.mealList];
            }



            this.calGuideTotalPriceFunc(level1, level2);


            var carTotalCount = 0;
            for (var i = 0; i < this.mealList.length; i++) { // 先计算购物车中非规格商品的个数
                var item1 = this.mealList[i];
                for (var j = 0; j < item1.itemList.length; j++) {
                    var item2 = item1.itemList[j];
                    // if(parseInt(this.mealList[level1].itemList[level2].unitFlag)==1){// 数量
                    var count2 = item2.count ? item2.count : 0;
                    carTotalCount = carTotalCount + count2;
                    // }else{//  重量

                    // }
                }
            }
            for (var i = 0; i < this.mealList.length; i++) { // 计算购物车中的规格商品的个数
                var item1 = this.mealList[i];
                for (var j = 0; j < item1.itemList.length; j++) {
                    var item2 = item1.itemList[j];
                    if (item1.itemList[j].realDifferentGuideList) {
                        for (var k = 0; k < item2.realDifferentGuideList.length; k++) {
                            if (parseInt(item2.unitFlag) != 2) {
                                carTotalCount = carTotalCount + item2.realDifferentGuideList[k].guideCount;
                            } else { // 无论多少千克按1个
                                carTotalCount = carTotalCount + 1;
                            }
                        }
                        // carTotalCount = carTotalCount + item1.itemList[j].realDifferentGuideList.length;
                    }

                }
            }


            console.log('---carTotalCount---', carTotalCount);
            this.car_total_count = carTotalCount;


        },

        minusCarMealFunc(level1, level2) {
            console.log('jianshao--level1', level1, '----level2---', level2);
            // if(this.eatMethodsType==undefined){
            //   return   this.$message.warning('请选择堂食还是外带');
            // }
            this.car_total_count = this.car_total_count - 1;


            this.mealList[level1].itemList[level2].count = this.mealList[level1].itemList[level2].count - 1;
            this.mealList[level1].itemList[level2].tempCount = this.mealList[level1].itemList[level2].count;
            this.mealList = [...this.mealList];

            console.log('1111减少菜后', this.mealList);
            console.log('值为--', this.mealList[level1].itemList[level2].count);


            this.calGuideTotalPriceFunc(level1, level2);

        },

        // 点餐系统

        minusTempMealFunc(level1, level2) {


            console.log('当前商品规格---', this.currentAttributeList);
            if (this.currentAttributeList.length) { //有规格逻辑
                if (this.currentGuideCount == 0) {
                    this.$message.warning("数量不能小于0");
                    return;
                }
                console.log('临时--减少菜--规格类');
                // 必须先添加完规格才可以添加数量，否则构造数据很麻烦
                var dishFlavorStr = '';
                for (var i = 0; i < this.currentAttributeList.length; i++) {
                    var items = this.currentAttributeList[i];

                    for (var j = 0; j < items.attrValueList.length; j++) { // 某个属性(多个值)
                        var subItems = items.attrValueList[j];
                        if (subItems.tempSelect) {
                            dishFlavorStr = dishFlavorStr + subItems.attrValue + '/';
                        }
                    }

                }
                if (dishFlavorStr) {
                    dishFlavorStr = dishFlavorStr.substring(0, dishFlavorStr.length - 1);
                }
                console.log('dishFlavorStr---', dishFlavorStr);
                var dishList = dishFlavorStr ? dishFlavorStr.split('/') : [];
                if (dishList.length != this.currentAttributeList.length) {
                    return this.$message.warning('请先补全规格');
                }
                this.currentGuideCount = this.currentGuideCount - 1;
                console.log('操作-后，规格数量为', this.currentGuideCount);


            } else {
                console.log('临时--减少菜--非规格类');
                if (!this.mealList[level1].itemList[level2].tempCount || this.mealList[level1].itemList[level2].tempCount <= 1) {
                    this.$message.warning("该区域最少数量为1，请在左侧栏减少");
                    return;
                }

                this.mealList[level1].itemList[level2].tempCount = this.mealList[level1].itemList[level2].tempCount - 1;
                this.mealList = [...this.mealList];

                console.log('减少菜后', this.mealList);
                console.log('值为--', this.mealList[level1].itemList[level2].count);
            }



        },




        addTempMealFunc(level1, level2) {
            console.log('----level1--', level1, '---level2', level2);
            console.log('----currentLevel1--', this.currentLevel1, '---level2', this.currentLevel2);
            // console.log('this.mealList[level1].itemList[level2].dishAttrList',this.mealList[level1].itemList[level2].dishAttrList);
            console.log('currentAttributeList--++', this.currentAttributeList);
            if (this.currentAttributeList.length) { //有规格逻辑
                console.log('临时--增加菜--规格类');
                // 必须先添加完规格才可以添加数量，否则构造数据很麻烦
                var dishFlavorStr = '';
                for (var i = 0; i < this.currentAttributeList.length; i++) {
                    var items = this.currentAttributeList[i];

                    for (var j = 0; j < items.attrValueList.length; j++) { // 某个属性(多个值)
                        var subItems = items.attrValueList[j];
                        if (subItems.tempSelect) {
                            dishFlavorStr = dishFlavorStr + subItems.attrValue + '/';
                        }
                    }

                }
                if (dishFlavorStr) {
                    dishFlavorStr = dishFlavorStr.substring(0, dishFlavorStr.length - 1);
                }
                console.log('dishFlavorStr---', dishFlavorStr);
                var dishList = dishFlavorStr ? dishFlavorStr.split('/') : [];
                if (dishList.length != this.currentAttributeList.length) {
                    return this.$message.warning('请先补全规格');
                }
                this.currentGuideCount = this.currentGuideCount + 1;
                console.log('操作+后，规格数量为', this.currentGuideCount);


            } else {
                console.log('临时--增加菜--非规格类');

                // 某个商品总个数
                if (!this.mealList[level1].itemList[level2].tempCount) {
                    this.mealList[level1].itemList[level2].tempCount = 2;
                } else {
                    this.mealList[level1].itemList[level2].tempCount = this.mealList[level1].itemList[level2].tempCount + 1;
                }
                // this.temp_car_total_count = this.temp_car_total_count ? this.temp_car_total_count + 1 : 2;
                // this.mealList[level1].currentTempCount = this.mealList[level1].currentTempCount ? (this.mealList[level1].currentTempCount + 1) : 2;
                // console.log('临时-增加--总个数---', this.mealList[level1].currentTempCount);
                this.mealList = [...this.mealList];


                // console.log('temp_car_total_count---', this.temp_car_total_count);
                console.log('增加菜后', this.mealList);

                console.log('值为--', this.mealList[level1].itemList[level2].tempCount);

            }




        },
        // addMealFunc(level1, level2) {

        //     // if(this.eatMethodsType==undefined){
        //     //   return   this.$message.warning('请选择堂食还是外带');
        //     // }
        //     console.log('gggh确认--增加菜');
        //     // this.car_total_count = this.temp_car_total_count;
        //     console.log('tempCount处理前---', this.mealList[level1].itemList[level2].tempCount);
        //     console.log('tempWeight处理前---', this.mealList[level1].itemList[level2].tempWeight);
        //     if (!this.currentAttributeList.length) { // 非规格
        //         console.log('非规格');
        //         if (parseInt(this.mealList[level1].itemList[level2].unitFlag) != 2) { // 数量
        //             // 没有临时输入的值或者临时值为1
        //             if (!this.mealList[level1].itemList[level2].tempCount || this.mealList[level1].itemList[level2].tempCount == 1) {

        //                 this.mealList[level1].itemList[level2].count = 1;

        //             } else {
        //                 this.mealList[level1].itemList[level2].count = this.mealList[level1].itemList[level2].tempCount;

        //             }
        //         } else if (parseInt(this.mealList[level1].itemList[level2].unitFlag) == 2) { // 重量
        //             // 
        //             this.mealList[level1].itemList[level2].customWeight = this.mealList[level1].itemList[level2].tempWeight;
        //             console.log('iiyu是重量', this.mealList[level1].itemList[level2].customWeight);
        //             this.mealList[level1].itemList[level2].count = 1;
        //         }
        //     }

        //     this.mealList = [...this.mealList];
        //     console.log('=dd===',this.mealList);
        //     // return;
        //     var carTotalPirce = 0;
        //     var onlyShopTotalPrice = 0;
        //     var totalNoJoinVipPrice = 0;
        //     for (var i = 0; i < this.mealList.length; i++) { // 计算非规格的总价
        //         var item1 = this.mealList[i];
        //         for (var j = 0; j < item1.itemList.length; j++) {
        //             var item2 = item1.itemList[j];
        //             var count2;

        //             if (!item2.realDifferentGuideList || item2.realDifferentGuideList == undefined) {
        //                 console.log('----item2.realDifferentGuideList', item2.realDifferentGuideList);
        //                 if (item2.unitFlag != 2) {

        //                     count2 = item2.count ? item2.count : 0;
        //                     console.log('是数量', count2);
        //                 } else { // 重量

        //                     count2 = item2.customWeight ? item2.customWeight : 0;
        //                     console.log('454545是重量', count2);
        //                 }

        //                 if (i == level1 && j == level2) { // 当前添加的
        //                     console.log('items2----', item2, '----eatMethodsType--', this.eatMethodsType);

        //                     // var dealCount = item2.count ? item2.count + 1 : 1;
        //                     // var dealCount = item2.count;
        //                     var dealCount = count2;
        //                     console.log('加上总包装费', item2.packingFee * dealCount);
        //                     if (this.eatMethodsType == 4) {
        //                         if(parseInt(item2.payRateFlag)==0){// 不参与会员折扣
        //                             totalNoJoinVipPrice = item2.price * dealCount  + item2.packingFee * dealCount + totalNoJoinVipPrice;
        //                         }else{
        //                             carTotalPirce = carTotalPirce + item2.price * dealCount + item2.packingFee * dealCount;
        //                         }
                               
        //                     } else {
        //                         if(parseInt(item2.payRateFlag)==0){// 不参与会员折扣
        //                             totalNoJoinVipPrice = item2.price * dealCount + totalNoJoinVipPrice;
        //                         }else{
        //                             carTotalPirce = carTotalPirce + item2.price * dealCount;
        //                         }
                               
        //                     }
        //                     onlyShopTotalPrice = onlyShopTotalPrice + item2.price * dealCount;

                            

        //                 } else {
        //                     console.log('fdfdfdfd----', item2);
        //                     if (this.eatMethodsType == 4) {
        //                         if(parseInt(item2.payRateFlag)==0){// 不参与会员折扣
        //                             totalNoJoinVipPrice = item2.price * count2 + item2.packingFee * count2 + totalNoJoinVipPrice;
        //                         }else{
        //                             carTotalPirce = carTotalPirce + item2.price * count2 + item2.packingFee * count2;
        //                         }
                              
        //                     } else {
        //                         if(parseInt(item2.payRateFlag)==0){// 不参与会员折扣
        //                             totalNoJoinVipPrice = item2.price * count2 + totalNoJoinVipPrice;
        //                         }else{
        //                             carTotalPirce = carTotalPirce + item2.price * count2;
        //                         }
                             
        //                     }
        //                     onlyShopTotalPrice = onlyShopTotalPrice + item2.price * count2;
        //                 }
        //             }
        //         }
        //     }
       
        //     for (var i = 0; i < this.mealList.length; i++) { // 计算规格的总价
        //         var item1 = this.mealList[i];
        //         for (var j = 0; j < item1.itemList.length; j++) {
        //             var item2 = item1.itemList[j];
        //             var count2;
        //             if (item2.realDifferentGuideList) {
        //                 for (var k = 0; k < item2.realDifferentGuideList.length; k++) {
        //                     var item3 = item2.realDifferentGuideList[k];
        //                     if (item2.unitFlag != 2) { // 是item2下的
        //                         console.log('jjj--', item3.guideCount);
        //                         count2 = item3.guideCount != undefined ? item3.guideCount : 0; // 取item3
        //                         console.log('a是数量', count2);
        //                     } else { // 重量

        //                         // count2 = item2.customWeight ? item2.customWeight : 0;
        //                         // count2 = this.currentGuideWeight ? this.currentGuideWeight : 0;
        //                         count2 = item3.guideCount != undefined ? item3.guideCount : 0; // 取item3
        //                         console.log('a是重量', count2);
        //                     }

        //                     if (i == level1 && j == level2) { // 当前添加的
        //                         console.log('aitems2----', item2);

        //                         var dealCount = count2;
        //                         console.log('a加上总包装费', item2.packingFee * dealCount);
        //                         if (this.eatMethodsType == 4) {
        //                             if(parseInt(item2.payRateFlag)==0){// 不参与会员折扣
        //                                 totalNoJoinVipPrice = item2.price * dealCount + item2.packingFee * dealCount + totalNoJoinVipPrice;
                                     
        //                             }else{
        //                                 carTotalPirce = carTotalPirce + item2.price * dealCount + item2.packingFee * dealCount;
        //                             }
                                    
        //                         } else {
        //                             if(parseInt(item2.payRateFlag)==0){// 不参与会员折扣
        //                                 totalNoJoinVipPrice = item2.price * dealCount + totalNoJoinVipPrice;
                                     
        //                             }else{
        //                                 carTotalPirce = carTotalPirce + item2.price * dealCount;
        //                             }
                                   
        //                         }


        //                         onlyShopTotalPrice = onlyShopTotalPrice + item2.price * dealCount;

        //                     } else {
        //                         console.log('afdfdfdfd----', item2);
        //                         if (this.eatMethodsType == 4) {
        //                             if(parseInt(item2.payRateFlag)==0){// 不参与会员折扣
        //                                 totalNoJoinVipPrice = item2.price * count2 + item2.packingFee * count2 + totalNoJoinVipPrice;
                                     
        //                             }else{
        //                                 carTotalPirce = carTotalPirce + item2.price * count2 + item2.packingFee * count2;
        //                             }
                                    
        //                         } else {
        //                             if(parseInt(item2.payRateFlag)==0){// 不参与会员折扣
        //                                 totalNoJoinVipPrice = item2.price * count2 + totalNoJoinVipPrice;
                                     
        //                             }else{
        //                                 carTotalPirce = carTotalPirce + item2.price * count2;
        //                             }
                                    
        //                         }
        //                         onlyShopTotalPrice = onlyShopTotalPrice + item2.price * count2;
        //                     }
        //                 }
        //             }



        //         }
        //     }


        //     this.allTotalNoJoinVipPrice = totalNoJoinVipPrice;
        //     // this.carl_total_price = carTotalPirce;
        //     this.carl_total_price = carTotalPirce + totalNoJoinVipPrice;
        //     console.log('carTotalPirce----', carTotalPirce,'-==',totalNoJoinVipPrice);
        //     console.log('allTotalNoJoinVipPrice----', this.allTotalNoJoinVipPrice);


        //     this.onlyShopTotalPrice = onlyShopTotalPrice;
        //     console.log('55555-aaa当前-0--', this.carl_total_price);



        //     this.mealList = [...this.mealList];


        //     var carTotalCount = 0;
        //     for (var i = 0; i < this.mealList.length; i++) { // 先计算购物车中非规格商品的个数
        //         var item1 = this.mealList[i];
        //         for (var j = 0; j < item1.itemList.length; j++) {
        //             var item2 = item1.itemList[j];
        //             // if(item2.realDifferentGuideList){

        //             // }else{
        //             // if (!item2.realDifferentGuideList || item2.realDifferentGuideList == undefined) {
        //                 // if (!item2.realDifferentGuideList.length) {
        //                 console.log('---vv--bb-',item2.realDifferentGuideList);
        //                 console.log('---item2.count',item2.count);
        //                 // if (item2.realDifferentGuideList.length==0) {
        //                     var count2 = item2.count ? item2.count : 0;
        //                     carTotalCount = carTotalCount + count2;
        //                 // }
        //                 // }
        //             // }
        //         }
        //     }
        //     for (var i = 0; i < this.mealList.length; i++) { // 计算购物车中的规格商品的个数
        //         var item1 = this.mealList[i];
        //         for (var j = 0; j < item1.itemList.length; j++) {
        //             var item2 = item1.itemList[j];
        //             if (item1.itemList[j].realDifferentGuideList) { // 规格
        //                 for (var k = 0; k < item2.realDifferentGuideList.length; k++) {
        //                     if (parseInt(item2.unitFlag) != 2) {
        //                         carTotalCount = carTotalCount + item2.realDifferentGuideList[k].guideCount;
        //                     } else { // 无论多少千克按1个
        //                         carTotalCount = carTotalCount + 1;
        //                     }

        //                 }
        //                 // carTotalCount = carTotalCount + item1.itemList[j].realDifferentGuideList.length;
        //             }



        //         }
        //     }


        //     console.log('---carTotalCount---', carTotalCount);
        //     this.car_total_count = carTotalCount;


        //     console.log('tempCount处理后---', this.mealList[level1].itemList[level2].tempCount);
        //     console.log('tempWeight处理后---', this.mealList[level1].itemList[level2].tempWeight);
        //     console.log('增加菜后', this.mealList);
        //     console.log('值为--', this.mealList[level1].itemList[level2].count);
         
        //     // this.abcd = this.mealList[level1].itemList[level2].count + '' + new Date().valueOf();// 数据变更，保证数据刷新
        //     this.bottomScrollClick();
        // },

        onShopCategoryChange(value) {
            console.log("商品分类改变", value);
        },
        changeGuideWeightTitle(e, level1, level2) {
            const { value } = e.target;
            console.log('value---', value);
            this.currentGuideWeight = parseInt(value);
        },
        changeWeightTitle(e, level1, level2) {
            // console.log('ee----',e);
            // return;
            const { value } = e.target;




            console.log('value为', value, '===level1--', level1, '===level2--', level2);
            // this.mealList[level1].itemList[level2].tempWeight = parseInt(value);
            this.mealList[level1].itemList[level2].tempWeight = value;


            // var carTotalCount = 0;
            // var carTotalPirce = 0;
            // for (var i = 0; i < this.mealList.length; i++) {
            //     var item1 = this.mealList[i];
            //     for (var j = 0; j < item1.itemList.length; j++) {
            //         var item2 = item1.itemList[j];
            //         var count2 = item2.count ? item2.count : 0;
            //         carTotalCount = carTotalCount + count2;
            //         carTotalPirce = carTotalPirce + item2.price * count2;


            //     }
            // }
            // console.log('---carTotalCount---', carTotalCount);
            // this.car_total_count = carTotalCount;
            // this.carl_total_price = carTotalPirce;
            // this.mealList = [...this.mealList];
            // console.log('---mealList---', this.mealList);

        },
        changeTitle(e, level1, level2) {
            // console.log('ee----',e);
            // return;
            const { value } = e.target;




            console.log('value为', value, '===level1--', level1, '===level2--', level2);
            this.mealList[level1].itemList[level2].count = parseInt(value);
            // this.mealList[level1].itemList[level2].Calprice = this.mealList[level1].itemList[level2].price*value;

            var carTotalCount = 0;
            var carTotalPirce = 0;
            for (var i = 0; i < this.mealList.length; i++) {
                var item1 = this.mealList[i];
                for (var j = 0; j < item1.itemList.length; j++) {
                    var item2 = item1.itemList[j];
                    var count2 = item2.count ? item2.count : 0;
                    carTotalCount = carTotalCount + count2;
                    carTotalPirce = carTotalPirce + item2.price * count2;


                }
            }
            console.log('---carTotalCount---', carTotalCount);
            this.car_total_count = carTotalCount;
            this.carl_total_price = carTotalPirce;
            this.mealList = [...this.mealList];
            console.log('---mealList---', this.mealList);
            // this.attributeList[index].title= value;
        },
        getmealListFunc() {
          
            // var json = JSON.parse(this.cbStoreInfo);
            // if (!json) {
            //     this.$router.replace("/login");
            //     return;
            // }


            
            var jsonParams = {
                userId: this.cbUserId,
                token: this.cbToken,
                storeId: this.cbStoreId,
             };
            //  console.log('aa-dsd---',jsonParams);

            this.$http
          .post(
            this.globalRequestUrl.getStoreClassifyListAndItemForEatPCAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            if (res.data.status == 200) {
              console.log("getStoreClassifyListAndItemForEatPCAPI---", res);
            //   this.mealList = [];
            //   this.mealList = res.data.data.storeCatList;


              this.mealList = [];
                console.log("net---mealList--res为", res);
                this.mealList = res.data.data.storeCatList;
                for (var i = 0; i < this.mealList.length; i++) {
                    var item1 = this.mealList[i];
                    // item1.differentGuideList = [];// 构造属性
                    // item1.realDifferentGuideList = [];
                    for (var m = 0; m < item1.itemList.length; m++) {
                        var item2 = item1.itemList[m];
                        item2.dishAttrList = [];
                        item2.differentGuideList = [];// 构造属性
                        item2.realDifferentGuideList = [];
                        var json1 = {};
                        var oneList = [];
                        if (item2.skuList == null) {
                            item2.skuList = [];
                        }
                        for (var j = 0; j < item2.skuList.length; j++) {
                            var item3 = item2.skuList[j];
                            var json2 = {};
                            json2.createTime = item3.createTime;
                            json2.attrId = item3.id;
                            json2.image = item3.image;
                            json2.itemId = item3.itemId;
                            json2.id = item3.itemId;
                            json2.num = item3.num;
                            json2.price = item3.price;
                            json2.status = item3.status;
                            json2.attrValue = item3.title;
                            json2.weight = item3.weight;
                            json2.unitFlag = parseInt(item2.unitFlag);
                            oneList.push(json2);

                        }
                        json1.attrName = oneList.length ? '规格(' + oneList.length + ')' : '';
                        json1.attrValueList = oneList;
                        json1.id = '';
                        json1.itemId = item2.id;
                        console.log('--json1.attrValueList.length-', json1.attrValueList.length);
                        if (json1.attrValueList.length) {
                            item2.dishAttrList.push(json1);
                        }

                    }
                }
                this.mealList = [...this.mealList];
                console.log('aaa最新构造完毕----', this.mealList);




          
            } else {
              this.$message.error(res.data.msg);
            }
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });



          
        },








        getStoreInfoFunc(){

      
            
      var jsonParams = {
                userId: this.cbUserId,
                token: this.cbToken,
                storeId: this.cbStoreId,
             };
            //  console.log('aa-dsd---',jsonParams);

            this.$http
          .post(
            this.globalRequestUrl.GETSTOREINFOAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            if (res.data.status == 200) {
            //   console.log("GETSTOREINFOAPI---", res);
              this.manDiscountFlag = parseInt(res.data.data.manDiscountFlag);

          
            } else {
              this.$message.error(res.data.msg);
            }
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });




      },


        getTableNumFunc() {


   
            // var json = JSON.parse(this.cbStoreInfo);
            // if (!json) {
            //     this.$router.replace("/login");
            //     return;
            // }



   

            var jsonParams = {
                userId: this.cbUserId,
                token: this.cbToken,
                storeId: this.cbStoreId,
             };
            //  console.log('aa-dsd---',jsonParams);

            this.$http
          .post(
            this.globalRequestUrl.getStoreDeskListForOrderAPI,
            this.qs.stringify(jsonParams)
          )
          .then((res) => {
            if (res.data.status == 200) {
              console.log("登a录信息---", res);
              this.tableNumList = res.data.data.result_list;
                this.currentEatMethodsIndex = this.tableNumList.length?0:1;
                this.eatMethodsType = this.tableNumList.length?3:4;

          
            } else {
              this.$message.error(res.data.msg);
            }
          })
          .catch(function (err) {
            // this.$message.error("服务器错误，请检查！");
          });



          




        },
    
    },
    beforeDestroy() {
    // window.removeEventListener('resize', this.adjustLogoPosition); // 在组件销毁前移除事件监听
  },
    mounted() {
        // this.adjustLogoPosition(); // 在组件挂载时调整 logo 位置
    // window.addEventListener('resize', this.adjustLogoPosition); // 在窗口大小改变时调整 logo 位置



             this.selectYearAndMonthAndDay();

        var json = JSON.parse(window.localStorage.getItem("cbStoreInfo"));
    // console.log('ffg=g==',window.localStorage.getItem("cbStoreInfo"));
    this.headImgUrl = json.storeImage;
    this.storeName = json.name;


    this.nowtimer = setInterval(this.gettime, 1000);
     this.currentScreenHeight = window.innerHeight - 74 - 120;  // 74 是中间内容距离顶部的距离 。 120是底部操作按钮的高度

     console.log('currentScreenHeight----', this.currentScreenHeight);
    // this.currentScreenHeight = 150;
        var json = JSON.parse(window.localStorage.getItem("cbUserInfo"));
    this.userName = json.username?json.username:json.phone;
        this.scrollInit();

        this.getTableNumFunc();
        this.getmealListFunc();
        this.getOftenListFunc();
        this.getStoreInfoFunc();
        this.getStorePayTypeList();



        // $(".el-col-22").css("width", "100%");
    },
};
</script>

<style scoped lang="less">
.basic_info_box {
    background-color: #f4f4f4;
    height: 36px;
    line-height: 36px;
    font-size: 14px;
    color: #282828;
    padding-left: 14px;
}

.left_word_box {
    // width: 100px;
    line-height: 40px;
}

.margin_fill {
    display: flex;
    align-items: center;
    margin: 14px 0;
}

.meal_list {
    // margin: 14px 0;
    margin-top: 20px;
}

.cate_meal_box {
    display: flex;
    overflow-x: scroll; // margin: 14px 0;
    align-items: center;
    height: 78px;
    border-bottom: 1px solid #f2f2f2;
    user-select: none;
    -ms-user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
}

.unselect_cate_item {
    color: #808080;
    background: #F2F2F2;
    border: 1px solid #F2F2F2;
    justify-content: center;
    display: flex;
    align-items: center;
    margin-right: 20px;
    border-radius: 4px;
    padding: 3px 20px;
    height: 30px;
    color: #000000;
}

.select_cate_item {
    color: #ED6A1F;
    background: rgb(253, 240, 232);
    border: 1px solid #ED6A1F;
    justify-content: center;
    display: flex;
    align-items: center;
    margin-right: 20px;
    border-radius: 4px;
    padding: 3px 20px;
    height: 30px;
    color: #ed6a1f;
}

// .select_cate_item {
//     display: flex;
//     padding: 3px 20px;
//     height: 30px;
//     border-radius: 5px;
//     background: white;
//     color: #747474;
//     margin-right: 9px;
//     border: 1px solid red;
//     flex-shrink: 0;
// }
// .unselect_cate_item {
//     display: flex;
//     flex-shrink: 0;
//     padding: 3px 20px;
//     height: 30px;
//     border-radius: 5px;
//     background: white;
//     color: #747474;
//     margin-right: 9px;
//     border: 1px solid #f2f2f2;
// }
.require_fill_star {
    font-size: 16px;
    color: #f70e0e;
}

.avatar-uploader>.ant-upload {
    width: 128px;
    height: 128px;
}

.ant-upload-select-picture-card i {
    font-size: 32px;
    color: #999;
}

.ant-upload-select-picture-card .ant-upload-text {
    margin-top: 8px;
    color: #666;
}

.ant-upload-select-picture-card img {
    width: 128px;
    height: 128px;
}

.bottom_save {
    position: absolute;
    left: 200px;
    right: 0;
    margin-top: 26px;
    height: 64px;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
}

.attribute_box {
    /* width: 100%; */
}

.attribute_box li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f7f8fa;
    border: solid 1px #d9d9d9;
    height: 63px;
    margin: 10px 0;
    padding: 0 21px;
}

.attribute_content {
    display: flex;
    align-items: center;
    color: #282828;
    font-size: 14px;
}

.right_box {
    display: flex;
    flex-direction: column;
}

.toast_weight_input_border {
    width: 100%;
    border: 1px solid #f2f2f2;
    height: 25px;
    padding: 4px 11px;
}

/deep/.toast_weight_input_border:focus {
    border: 1px solid #f2f2f2;
}

.toast_input_border {
    /* border: 1px solid #d9d9d9; */
    border-left: 1px solid transparent;
    border-right: 1px solid transparent;
    height: 25px;
    padding: 4px 11px; // border-radius: 4px;
    text-align: center;
    /* 
>>>::focus{
  border: 1px solid red;
} */
}

/deep/.toast_input_border:focus {
    border-left: 1px solid transparent;
    border-right: 1px solid transparent;
}

.input_border {
    /* border: 1px solid #d9d9d9; */
    border: 1px solid transparent;
    height: 25px;
    padding: 4px 11px;
    border-radius: 4px;
    text-align: center;
    /* 
>>>::focus{
  border: 1px solid red;
} */
}

/deep/.input_border:focus {
    border: 1px solid transparent;
}

input:focus {
    outline: none;
    border: 1px solid #40a9ff;
}

input::-webkit-input-placeholder {
    /* WebKit browsers */
    color: #ccc;
}

input:-moz-placeholder {
    /* Mozilla Firefox 4 to 18 */
    color: #ccc;
}

input::-moz-placeholder {
    /* Mozilla Firefox 19+ */
    color: #ccc;
}

input:-ms-input-placeholder {
    /* Internet Explorer 10+ */
    color: #ccc;
}

.ivu-upload {
    display: none;
}

.el-form-item__content {
    display: none;
}

.frequently_toast_box {
    position: fixed;
    z-index: 3;
    /* width: 500px; */
    /* height: 100%; */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: transparent;
}

.unactive_shop_status {
    text-align: center;
    width: 100px;
    height: 40px;
    line-height: 40px;
    border: 1px solid #d9d9d9;
    border-radius: 3px;
    margin-left: 14px;
    color: #000000;
}

.active_shop_status {
    text-align: center;
    width: 100px;
    height: 40px;
    line-height: 40px;
    border: 1px solid #1890ff;
    border-radius: 3px;
    margin-left: 14px;
    color: #1890ff;
}

.meal_box {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    /* overflow-x: auto; */
}

.meal_content_box {
    position: relative; // border: 1px solid #f2f2f2;
    // border-radius: 10px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    display: flex;
    flex-direction: column;
    margin-right: 20px; // height: 300px;
}

.saleout {
    position: absolute;
    left: 0;
    top: 0;
    font-size: 60px;
    line-height: 60px;
}

.car_meal_input_ope {
    line-height: 25px;
    display: flex;
    align-items: center;
    border-radius: 4px; // width: 152px; // margin:0 12px 13px 12px;
    border: 1px solid #f2f2f2;
    -moz-user-select: none;
    /*火狐*/
    -webkit-user-select: none;
    /*webkit浏览器*/
    -ms-user-select: none;
    /*IE10*/
    -khtml-user-select: none;
    /*早期浏览器*/
    user-select: none;
}

.meal_input_ope {
    // line-height: 25px;
    display: flex;
    align-items: center; // border-radius: 4px;
    // margin: 0 12px 13px 12px;
    // border: 1px solid #f2f2f2;
    -moz-user-select: none;
    /*火狐*/
    -webkit-user-select: none;
    /*webkit浏览器*/
    -ms-user-select: none;
    /*IE10*/
    -khtml-user-select: none;
    /*早期浏览器*/
    user-select: none;
}

.one_ope {
    display: flex;
    justify-content: flex-end;
    line-height: 25px;
    display: flex;
    align-items: center;
    border-radius: 4px;
    margin: 0 12px 13px 12px;
    border: 1px solid transparent;
}

.one_box {
    // width: 100%;
    margin-right: 12px;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 13px;
}

.plus_ope {
    // width: 34px;
    height: 25px;
    line-height: 25px;
    margin-right: 12px;
    border-radius: 4px;
    border: 1px solid #f2f2f2;
}

.car_input_ope_left_btn {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    border-right: 1px solid #f2f2f2;
    width: 25px;
    height: 25px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    ; // flex: 1;
}

.car_input_ope_right_btn {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    border-left: 1px solid #f2f2f2;
    width: 25px;
    height: 25px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center; // flex: 1;
}

.input_ope_left_btn {
    // border-top-left-radius: 4px;
    // border-bottom-left-radius: 4px;
    // border-radius: 4px;
    border: 1px solid #f2f2f2; // border-right: 1px solid #f2f2f2;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    ; // flex: 1;
}

.input_ope_right_btn {
    // border-top-right-radius: 4px;
    // border-bottom-right-radius: 4px;
    // border-left: 1px solid #f2f2f2;
    // border-radius: 4px;
    border: 1px solid #f2f2f2;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center; // flex: 1;
}

.one_right_btn {
    border-radius: 4px;
    border: 1px solid #f2f2f2;
    width: 25px;
    height: 25px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center; // flex: 1;
}

.car_box {
    padding: 0 24px; // width: 500px; // border: 1px solid #f2f2f2;
    // border-radius: 5px;
}

.car_title_box {
    display: flex;
    justify-content: space-between; // background: rgb(250, 250, 250);
    line-height: 50px;
    padding: 0 24px;
}

.car_column_title {
    display: flex; // padding: 0 24px;
    line-height: 40px;
    border-bottom: 1px solid #f2f2f2;
}

.car_shop_cat {
    line-height: 30px;
    /* padding:0 24px; */
}

.car_shop_cont {
    // margin: 0 24px;
}

.car_shop_info {
    display: flex;
    align-items: center;
    /* padding:0 24px; */
    padding: 10px 0;
}

.car_cal_price {
    border-top: 1px dashed #f2f2f2;

    display: flex;
    align-items: center;
    justify-content: space-between; // padding: 0 24px;
}

.total_box {
    display: flex;
    flex-direction: column;
}

.user_box {
    width: 100%;
}

.user_info {
    width: 400px;
    display: flex; // margin: 0 30px;
    padding: 14px;
    border: 1px solid #f2f2f2;
    border-radius: 3px; // justify-content: space-between;
    align-items: center;
}

.guide_toast_box {
    /* position: absolute; */
    position: fixed;
    z-index: 3;
    /* width: 500px; */
    /* height: 100%; */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.toast_box {
    /* position: absolute; */
    position: fixed;
    z-index: 3;
    /* width: 500px; */
    /* height: 100%; */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.add_toast_box {
    background-color: white;
    width: 400px;
    /* height: 250px; */
    // min-height: 250px;
    border-radius: 3px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
}

.add_top {
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 50px;
    background-color: #ED6A1F;
    border-bottom: 1px solid #f2f2f2;
}

.add_bottom {
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.add_bottom ul {
    width: 100%;
}

.add_bottom ul li {
    display: flex; // margin: 0 30px;
    padding: 14px;
    border: 1px solid #f2f2f2;
    border-radius: 3px;
    justify-content: space-between;
    align-items: center;
    margin: 20px;
}

.select_user_box {
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.select_user_box ul {
    width: 100%;
}

.select_user_box ul li {
    display: flex; // margin: 0 30px;
    height: 80px;
    width: 330px;
    border: 1px solid #f2f2f2;
    border-radius: 3px;
    justify-content: space-between;
    align-items: center;
    background: #F2F2F2;
    border-radius: 8px;
}

.search_box {
    padding: 0 20px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.price_guide_box {
    display: flex;
    justify-content: space-between;
    line-height: 50px;
    padding: 0 12px;
    color: #C1272D;
}

.add_guide_bottom {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    -moz-user-select: none;
    /*火狐*/
    -webkit-user-select: none;
    /*webkit浏览器*/
    -ms-user-select: none;
    /*IE10*/
    -khtml-user-select: none;
    /*早期浏览器*/
    user-select: none;
}

.add_content_box {
    margin: 12px;
}

.add_content_left_box {
    flex:1;
    // margin: 12px;
    background: white; // padding:15px 10px;
}

.add_content_right_box {
    flex:1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 10px;
    // flex: auto; // padding:15px 10px;
}

.tan_kuangtwo {
    margin: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.num_box {
    font-size: 16px;
    font-weight: 600;
    color: #000000;
}

.tag_tag_box {
    display: flex;
    flex-wrap: wrap;
}

.tag_nei {
    padding: 10px 30px;
    background: #F0F0F0;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 10px;
    display: inline-block; // margin-right: 20px;
    margin-right: 8px;
}

.tanactive {
    // background: #FFF1F0;
    // color: #FF554C;
    // box-sizing: border-box;
    // border: 1px solid #FF554C;
    color: #ED6A1F;
    background: rgb(253, 240, 232);
    border: 1px solid #ED6A1F;
    justify-content: center;
    display: flex;
    align-items: center; // margin-right: 20px;
    border-radius: 4px; // width:80px;
    height: 30px;
    padding: 0 20px;
    position: relative;
}

.tanunactive {
    // color: #000000;
    // box-sizing: border-box;
    // border: 1px solid transparent;
    color: #808080;
    background: #F2F2F2;
    border: 1px solid #F2F2F2;
    justify-content: center;
    display: flex;
    align-items: center; // margin-right: 20px;
    border-radius: 4px; // width:80px;
    height: 30px;
    padding: 0 20px;
    position: relative;
}

.un_select_eat_item {
    color: #808080;
    background: #F2F2F2;
    border: 1px solid #F2F2F2;
    justify-content: center;
    display: flex;
    align-items: center;
    margin-right: 20px;
    border-radius: 4px;
    width: 80px;
    height: 30px;
    position: relative;
    color: #000000;
}

.select_eat_item {
    color: #ED6A1F;
    background: rgb(253, 240, 232);
    border: 1px solid #ED6A1F;
    justify-content: center;
    display: flex;
    align-items: center;
    margin-right: 20px;
    border-radius: 4px;
    width: 80px;
    height: 30px;
    position: relative;
    color: #ed6a1f;
}

.spe_box {
    display: flex;
}

.check_left {
    display: flex;
    align-items: center;
}

.check_right {}

.eat_methods_box {
    display: flex;
    align-items: center;
}

.table_num_box {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.often_mobile_box {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.un_select_table_num_item {
    color: #808080;
    background: #F2F2F2;
    border: 1px solid #F2F2F2;
    justify-content: center;
    display: flex;
    align-items: center;
    margin-right: 20px;
    border-radius: 4px; // width:80px;
    height: 30px;
    padding: 0 10px;
    position: relative;
    color: #000000;
    margin-bottom: 13px;
}

.select_table_num_item {
    color: #ED6A1F;
    background: rgb(253, 240, 232);
    border: 1px solid #ED6A1F;
    justify-content: center;
    display: flex;
    align-items: center;
    margin-right: 20px;
    border-radius: 4px; // width:80px;
    height: 30px;
    padding: 0 10px;
    position: relative;
    color: #ed6a1f;
    margin-bottom: 13px;
}

.right_check {
    color: red;
    font-size: 20px;
}

.un_select_mobile_item {
    color: #808080;
    background: #F2F2F2;
    border: 1px solid #F2F2F2;
    line-height: 28px;
    padding-left: 14px;
    padding-right: 14px; // padding:2px 5px;
    display: flex;
    align-items: center;
    margin-right: 20px;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    margin-bottom: 10px;
    color: #808080;
}

.select_mobile_item {
    color: #ED6A1F;
    background: rgb(253, 240, 232);
    border: 1px solid #ED6A1F;
    line-height: 28px;
    padding-left: 14px;
    padding-right: 14px; // padding:2px 5px;
    display: flex;
    align-items: center;
    margin-right: 20px;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    margin-bottom: 10px;
    color: #ed6a1f;
}

.un_select_normal_item {
    color: #808080;
    background: #F2F2F2;
    border: 1px solid #F2F2F2;
    line-height: 28px;
    padding-left: 14px;
    padding-right: 14px; // padding:2px 5px;
    display: flex;
    align-items: center;
    margin-right: 20px;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    margin-bottom: 10px;
    color: #000000;
}

.select_normal_item {
    color: #ED6A1F;
    background: rgb(253, 240, 232);
    border: 1px solid #ED6A1F;
    line-height: 28px;
    padding-left: 14px;
    padding-right: 14px; // padding:2px 5px;
    display: flex;
    align-items: center;
    margin-right: 20px;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    margin-bottom: 10px;
    color: #ed6a1f;
}

.cus_radio {
    /deep/ .ant-radio-wrapper {
        margin-bottom: 20px;
    }
}

.sale_out_img {
    position: absolute;
    width: 90px;
    height: 90px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.meal_img_box {
    position: relative;
}

.meal_all_box {
    display: flex;
    // position:relative;
    padding:74px 10px 0 10px;

}

.meal_left_box {
    // flex:2;
    overflow-y:scroll;
    // height:800px;
    width: 600px;
    // flex:1;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: white;
}

.meal_top_box {
    // position:relative;
    background: white;
    padding: 24px;
}

.meal_bottom_box {
    margin-top: 6px;
    background: white; // padding: 0 24px;
}

.meal_right_box {
    // position:relative;
    overflow:scroll;
    // height:850px;
    // width: 1px;
    padding: 0 20px; // flex:8;
    flex: auto; // width:700px;
    // flex:2;
    // background: green;
    background: white;
    border-left: 5px solid #f2f2f2;
}

/* 清空滚动条 */

::-webkit-scrollbar {
    display: none;
}

#tab_nav {
    overflow-x: auto;
    overflow-y: hidden;
}

.shop_title {
    height: 50px;
    padding: 0 12px; // border-bottom: 1px solid #f2f2f2;
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
}

.title_de {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.settle_item_box {
    padding: 20px 0;
}

.width_138 {
    display: inline-block;
    width: 138px;
}

.cle-box {}

.line_header_14 {
    color: #000000;
}

.line_header_18 {
    color: #000000;
    font-size: 18px;
    font-weight: 700;
}

.add_choice_bottom {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    -moz-user-select: none;
    /*火狐*/
    -webkit-user-select: none;
    /*webkit浏览器*/
    -ms-user-select: none;
    /*IE10*/
    -khtml-user-select: none;
    /*早期浏览器*/
    user-select: none;
    margin-bottom: 12px;
}

.choice_btn {
    background: #ED6A1F;
    color: white;
    width: 170px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast_weight_input {
    width: 100%;
    height: 36px;
    border: 1px solid #f2f2f2;
    /*火狐*/
    -webkit-user-select: none;
    /*webkit浏览器*/
    -ms-user-select: none;
    /*IE10*/
    -khtml-user-select: none;
    /*早期浏览器*/
    user-select: none; // margin-bottom:12px;
}

.toast_count_input {
    width: 50px;
    height: 36px;
    border-top: 1px solid #f2f2f2;
    border-bottom: 1px solid #f2f2f2;
    /*火狐*/
    -webkit-user-select: none;
    /*webkit浏览器*/
    -ms-user-select: none;
    /*IE10*/
    -khtml-user-select: none;
    /*早期浏览器*/
    user-select: none; // margin-bottom:12px;
}

.textarea_bg {
    background: #f2f2f2;
}

/deep/ textarea {
    background: #f2f2f2;
    color: #999999;
}

/deep/ .input_par input {
    background: #f2f2f2;
    color: #999999;
    height: 41px;
}

.add_all_box {
    display: flex;
    justify-content: space-between;
    background: rgb(230, 230, 230);
    padding: 10px;
}

.color_000 {
    color: #000000;
}

.color_8080 {
    color: #808080;
}

.choice_sure {
    flex:1;
    background-color: #fe6a24;
    height: 48px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 500;
}

.choice_cancel {
    flex:1;
    // margin-top: 10px;
    background-color: #808080;
    height: 48px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 500;
    margin-right:20px;
}

.toast_choice {
    width: 100%;
    display:flex;
    align-items:center;
}

.right_top_box {}

.color_999 {
    color: #999999;
}

.order_ul {
    padding:0;
    display: flex;
    flex-direction: column;
    width: 752px;
}

.order_li {
    display: flex;
    align-items: center;
    justify-content: center;
    padding:24px 0;
    // height: 54px;
    border-bottom: 1px solid #e8e8e8; //  flex:1;
}


.order_li div {
    flex: 1;
    text-align: center;
}
.card_select_ul {
    display: flex;
    flex-direction: column;
    width: 752px;
}

.card_select_li {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 54px;
    border-bottom: 1px solid #e8e8e8; //  flex:1;
}

.card_select_li div {
    flex: 1;
    text-align: center;
}

.gold_box{
    display:flex;
    flex-direction:column;
}
  
.toast_container_box {
  display: flex;
  align-items: center;
}
.mg24{
  margin-top:24px;
}
.bottom_ope_box{
    position:fixed;
    left:10px;
    bottom:0px;
    right:10px;
    display:flex;
}
.bottom_left_box{
    width: 600px;
    // flex:1;
    height:120px;
    flex-shrink: 0;
    display: flex;
    flex-direction:column;
}
.bottom_right_box{
    // position:absolute;
    // left:605px;
    // right:0;
    // bottom:0;
    margin-left:5px;
    height:120px;
    display:flex;
    flex-direction:column;
    flex: auto; // width:700px;
    // flex:2;
    align-items:center;

    justify-content:space-between;

  
    // width:100%;
    color:white;
 }
.right_oprt{
    display:flex;   
    justify-content:space-between;
    align-items:center;
    background-color: #1F58BC;
    width:100%;
    height:60px;
    padding:0 20px;
}
.bottom_right_ope{
    display:flex;
    align-items:center;
}
.ope_b{
    display:flex;
    flex-direction:column;
    align-items:center;
}
.text-op{
    margin-top:-3px;
}
.shop_ca_b{
    display:flex;
    height:60px;
}
.card_info_toast_box {
  /* margin: 0 auto; */
  background-color: white;
//   width: 900px;
  /* height: 250px; */
  border-radius: 3px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
}
.card_info_top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  background:#ED6A1F;
  color:white;
  border-bottom: 2px solid #f2f2f2;
  height: 50px;
  /* flex: 1; */
}
.card_info_bottom{
    
    display:flex;
    margin:10px 20px;
    
     overflow:scroll;
  
}
/deep/ .ant-table-tbody > tr > td {
  padding: 8px 16px !important;
  overflow-wrap: break-word; 
}

.container_box{
    position:relative;
}

.header_sty {
  display: flex;
  justify-content: space-between;

  .breadcrumb {
    line-height: 64px;
    margin-left: 20px;
  }

  .header_out {
    width: 100px;
    display: flex;
    align-items: center;
    float: right;
    line-height: 64px;
    padding-right: 20px;
    cursor: pointer;
  }
}

.demo-class{
  input{
    width: 300px;
    border:1px solid #ccc;
    outline: none;
    height: 30px;
    font-size: 16px;
    letter-spacing: 2px;
    padding: 0 5px;
  }
}
.input_class{
    border:1px solid #b8b8b8;
    width:226px;
    height: 32px;
    line-height: 32px;
    padding: 0 5px;
  }
  .margin-10{
    margin:0 10px;
  }
  .border_cl{
    // position:absolute;
    // left:24px;
    // top:70px;  // 24 + 14+ 32

    // width: 48%;
    // margin: 0 auto;
    // font-size: 18px;
    // border-radius: 2px;
    // padding-top: 0.5em;
    // background-color: #e5e6e8;
    // user-select: none;
    // position: fixed;
    // left: 50%;
    // top: 50%;
    // transform: translate(-50%, -50%);
  }

  .card_info_toast_box /deep/ .ant-pagination{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    margin:0px 20px 10px 20px;
  }

  textarea {
            display: block;
            width: 100%;
            min-height: 100px;
            padding: 0;
            margin: 20px 0;
            font-size: 16px;
        }
        .box {
  height: 100px;
  width: 100px;
  background-color: #ccc;
  position: absolute;
  top: 200px;
  left: 100px;
  cursor: pointer;
}
.wrap {
  position: relative;
  background:blue;
  width:1000px;
  height:1000px;
}

</style>
